Hi all - I've got an app that starts a service in order to receive location updates from the LocationManager. The use case is the service needs to be running all the time and as such it acquires a PowerManager.PARTIAL_WAKE_LOCK in the onCreate() of the Service.
But it seems from testing on several different phones and user feedback that the Service is still being put to sleep as the location notifications will stop if the application isn't in the foreground. This effectively renders the app ineffective for the task at hand. I've read posts about using an Alarm to simulate a pseudo cron job but I don't really need to be woken up in order to do a task, the app needs to run code based on the location manager calling onLocationChanged the service that the users position has changed. I'm pretty sure I've coded this service and application according to the best practices for this sort of application yet the fact that it effectively stops running in some cases is causing problems for the users. Any tips on how to keep a service going given the Android OS's tendency to put things to sleep? PowerManager.PARTIAL_WAKE_LOCK seemingly isn't a guarantee about anything which I can sort of understand but I've seen cases where the only app that I've launched after restarting the phone is my application and it still gets put to sleep. Thanks for any help. mike -- 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