Tuesday, December 4, 2012

[android-developers] Re: Wake locks android

You probably realize that just seizing a WakeLock for a long time is a really, really horrible idea, yes?  Given that, it isn't clear what you are actually trying to do.  Obviously, your service can't run when the device is asleep....

You can use the Alarm Manager in RTC_WAKEUP mode, to cause the device to be awakened, periodically, to run your service.  If you do that, you may have to seize a WakeLock to keep the device awake until your service has completed its task and is ready to let the device go back to sleep...

G. Blake Meike
Marakana

Programming Android 2ed is now in stores:
http://bit.ly/programmingandroid

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate