In my application I need to send SMS on a regular interval of 5 minutes. I can use a thread that will run in background using the wait() method, then I can wait for 5 minutes and send SMS at an interval of 5 minute.
I can also use a repeating alarm with 5 minute interval and then send the SMS.
Which one is better to use?
I would strongly recommend using the AlarmManager for this, as this will probably use less resources, also, this is a system facility that was already prepared for you.