On 11 Jan., 17:37, TreKing <treking...@gmail.com> wrote: > The likelihood of your Service running un-interrupted for 30 minutes, > especially if you're not running in the foreground, is extremely low.
Well, if really necessary, one could show a notification and use startForeground. I for one would go for a compromise: Use AlarmManager for the timing, unless you really, really need to be as exact as possible (Android is a multitasking system, and services usually don't have highest priority, so there'll always be some lack). But don't stop the service until after the 30 minutes are over. This way, you only have to do all the initialization work if the system killed your service, while AlarmManager saves you from aborted updates and having to use wake locks while idle. I think for as short as 30 minutes it's OK to keep the service running mostly idle if this saves the system from having to load and initialize every 5 minutes. Esp. if this might be connected with restarting GPS and searching for sattellites again and again... -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en