>> I am newer to Android development and I have a app that needs to run a
>> command even if the phone goes to sleep.
>>
>> I have it running as a service but it runs randomly when.
>> Is there a way to have the service run even when the phone is
>> sleeping.
>
> Use AlarmManager. Keep your service stopped normally, and use an alarm to
> wake up the device and run your code.
>
> http://tinyurl.com/y9mttv5

Whoops, sorry, errant URL paste there. I was aiming for:

http://www.androidguys.com/2009/04/02/wake-up-with-the-alarm/

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 
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

Reply via email to