Keep service running even if the phone is switched off
I'm developing a reminder app in which I'm running a background process and I want to keep it running always so that even if the phone is switched o开发者_如何学JAVAff, the service should remind the user of the reminders that were scheduled for that particular time after the phone is switched on.
Is it possible or do I need to manage it myself?
So you simply want the user to get notified, when he turns his phone ON, that there was a reminder, when your phone was off.
Do one thing: start your app as soon as phone starts. For that you will have to listen to the start up broadcast and start your app.
Then simply compare the present time with the time set in the reminder..
and the notify the user.
You can search the web to find out which broadcast you have to receive and process for starting your application at startup of phone. I think this link might help you.
精彩评论