In a service which method of delayed execution to be used handler.postdelayed or Alarmmanager. what are the pro and cons.
I have 2 services (a) which does background processing and updates the UI via a boradcast message (b) which does some calculation and updates the homescreen widget every 5 secs.
Thanks
I found this note in Android Developer's site:
http://developer.android.com/training/scheduling/alarms.html
It seems that AlarmManager would be the class to use for starting services.
Regarding Handlers it states that:
"For timing operations that are guaranteed to occur during the lifetime of your application, instead consider using the Handler class in conjunction with Timer and Thread. This approach gives Android better control over system resources."