On Sun, Dec 5, 2010 at 9:38 PM, ip332 <[email protected]> wrote: >> > Or should I try to create a kind of service thread that polls every >> > (n) minutes and sleeps in between, would that save battery? >> >> Yes, but it will waste RAM and cause you to be the target of task killers. > I disagree - it depends on how do you implement actual "runner". > > IMHO if you create location listener every X minutes and remove it > after you got a location update (10-60 seconds) - there is no wasted > RAM nor battery.
If you have a Service running 24x7 to accomplish this, yes, you are wasting RAM. > Also I would implement it using Hanlder.postAtTime() approach > described at > http://developer.android.com/resources/articles/timed-ui-updates.html Which implies a Service running 24x7, which means users will attack you with task killers. We can do better than this, with AlarmManager, but the work is just a bit tricky. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 2.2 Programming 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

