I have an alarm that fires every hour and executes code in specific conditions It works smoothly, but when I leave my app unopened (the alarm initialization is on app startup) it stops after some time, these are the logs:
8/2/2020 6:27 AM Initializing Alarm, next alarm will fire at 8/2/2020 3:27 AM
8/2/2020 6:27 AM Application starting.
8/2/2020 6:28 AM Application stopped.
8/2/2020 6:28 AM Reports alarm received.
8/2/2020 7:28 AM Reports alarm received.
8/2/2020 8:28 AM Reports alarm received.
8/2/2020 9:28 AM Reports alarm received.
8/2/2020 9:28 AM Reports alarm finished.
8/2/2020 10:28 AM Reports alarm received.
8/2/2020 10:28 AM Reports alarm finished.
8/2/2020 11:28 AM Reports alarm received.
8/2/2020 11:28 AM Reports alarm finished.
8/2/2020 12:30 PM Reports alarm received.
8/2/2020 12:30 PM Reports alarm finished.
8/2/2020 1:30 PM Reports alarm received.
8/2/2020 1:30 PM Reports alarm finished.
8/2/2020 2:30 PM Reports alarm received.
8/2/2020 2:30 PM Reports alarm finished.
8/3/2020 8:13 AM Initializing Alarm, next alarm will fire at 8/3/2020 5:13 AM
As you see between 2:30 PM to 8:13 AM the next day, no alarms were fired
This is the initialization:
alarmMgr.SetInexactRepeating(AlarmType.RtcWakeup, calendar.TimeInMillis, 1000 * 60 * 60, alarmIntent);
I have acquired the WAKE_LOCK permission.
Thanks in advance