Keep service running even if the phone is switched

2020-06-17 15:12发布

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 off, 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?

2条回答
你好瞎i
2楼-- · 2020-06-17 15:31
smile是对你的礼貌
3楼-- · 2020-06-17 15:41

so you simply want the user 2 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 2 listen 2 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 google 2 find out which broadcast you have 2 recieve and process for starting your application at startup of phone...

but i think this link might help you.....

查看更多
登录 后发表回答