Mark, It doesn't seem to consume battery. I've tried several solutions and only yours is really working. Before I used a regular service with a AlarmManager.set(...) to schedule service run every minute. It worked fine on emulator (even when killing the service) but on real devices it failed often. I mean sometimes the Alarm did no go off after a few hours. That's why I tried your solution based on AlarmManager.setRepeating(...).
What do you think about it ? On Mar 21, 9:28 pm, Mark Murphy <mmur...@commonsware.com> wrote: > Derek wrote: > > Refresh is every minute. > > :: blink, blink :: > > Every *minute*? > > That's not really a good idea. > > If you have a short-term need for an every-minute bit of work, you may > as well use a regular Service and a Timer/TimerTask. This would, by > definition, eliminate your classloading problem, because you wouldn't be > starting and stopping the service. > > If you have a long-term need for an every-minute bit of work, you might > want to switch to developing for things that don't run on really small > batteries and have very little RAM. :-) > > While my WakefulIntentService sample uses a five-minute period, even > that's kinda frequent -- I only use that to limit frustration for people > testing the code. > > > Here is the WakefulIntentService I'm using: > > That resembles one I wrote. Releasing the lock in finally {} is a good > move -- I need to fix mine for that. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android 2.0 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 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.