My Question: How do I have my application do something at a certain time? Especially in a case when it's not technically running (is that possible). Best practices? Event listener? Etc...
Expansion: I'm pretty new to Android development. I want to build a scheduling application which would control some features of the phone at pre-scheduled times. So let's say I schedule in the app to change from ring to vibrate at 3:00 and right now it's 2:00. So how do I capture the system time when it turns 3:00 to run that change?
I'm not sure whether any more information would be useful. I'm just trying to design this right now before I really get into developing it, so I'm looking for best practices and how to have an event listener run when the application is either running in the background or not running at all (if that's possible).
Don't forget permissions:
Thanks
You can use a
pendingIntent
with aBroadCastReceiver
like this:Then the BroadCast Receiver:
Don't forget to include these permissions in your
AndroidManifest.xml
:and broadcast receiver in application tag: