I asked (quite) the same question some time ago, and maybe it can help you https://groups.google.com/group/android-developers/browse_thread/thread/35f963dd905052c7/e7c3a28b1ed28230?hl=it&lnk=gst
As the always helpful Mark pointed out, you can't be sure that gps is not still around between updates, but maybe this PendingIntent approach can be of some interest. Federico On 12 Gen, 13:07, Mark Murphy <mmur...@commonsware.com> wrote: > On Wed, Jan 12, 2011 at 3:17 AM, Dianne Hackborn <hack...@android.com> wrote: > > If you want to avoid work when it starts every 5 minutes, keep your > > previous work in static globals to re-use the next time the service is > > created. > > To clarify, you will need to ensure that you can reload those static > globals as needed. While the process probably sticks around between > alarms, it might not, in which case those globals will be null and you > will have to regenerate that data. Consider these static globals to be > an optimization, not a load-bearing beam of your app. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android App Developer Books:http://commonsware.com/books -- 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