Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alarms in Android: need to be stored in the DB?

I have a doubt: if I create an alarm in Android using the AlarmManager, and I reboot the phone, will the alarm still be there, or should I store the alarms in the DB so when the phone is rebooted it'll be created again?

I read the documentation from Android but it doesn't say anything about it (or I just don't understand it). Could anyone please help here?

Thanks a lot in advance!

like image 886
noloman Avatar asked Dec 20 '25 06:12

noloman


1 Answers

Alarms do not survive reboot, so you need to register your Application to start on boot and re-register your alarms from what you stored in the database. This has been discussed for example here Clarification of AlarmManager behavior in Android.

like image 54
Lukas Ruge Avatar answered Dec 22 '25 20:12

Lukas Ruge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!