I am trying to make an alarm fire in my app every 30 minutes using Alarm Manager\'s setExactAndAllowWhileIdle but it is not working!
I test the function
You might get accurate alarms, but in Doze mode
The system ignores wake locks.
So it seems as though AlarmManager.setAlarmClock is the only acceptable solution if you really need to trigger every 30 minutes. This will probably negate all doze mode energy savings...
BTW: it seems like you can see alarms with adb shell dumpsys alarm.
Possibility: use Firebase JobDispatcher
The Firebase JobDispatcher is a library for scheduling background jobs in your Android app. It provides a JobScheduler-compatible API that works on all recent versions of Android (API level 14+) that have Google Play services installed.