I am working on a Security application, where i need to play siren music on receiving certain text(say “siren”).
So far, I’ve been able to receive the SMS intent and play the .mp3 siren music. But the problem encounters when the device is switched off.
Its been to my knowledge that there are some Intents(dont know what exactly to call them), those intents are fired even when the Device is switched off, just like the Scheduled Alarms (which executes even when the phone is switched off)
If anyone knows about those services or whatever they are, it would be helpfull if you share those ideas.
If you need device to be awaken when you do your tasks, then simply wake it up using PowerManager. Please note that once your
onReceive()is completed device may fall back to sleep, so if you spawn some other processed in yourBroadcastReceiver, you need to hold WakeLock.You may take a look at this as well: https://github.com/commonsguy/cwac-wakeful