Android get list of active alarms
Is there any way to get a list of all the active alarms in the android device programmatically in our application
programmatically.Just point me out to some links that can be of help I am basically trying to give the user the facility of viewing all the alarms in his device so i want to get a list of all the active alarms in the device.
3 Solutions collect form web for “Android get list of active alarms”
Short answer: you can’t.
The alarm manager gives no visibility to the alarms currently scheduled in the system. Every app that uses alarm manager must persist the state of each alarm that they set.
However you can get a list via adb as described in this question Get list of active PendingIntents in AlarmManager. And an app could get a system dump and get the alarms that way but that would require root.
No, AFAIK you can’t do that programmatically so showing that info to a user in UI is not feasible.
However for your own reference you can dump the alarm data via
adb shell dumpsys alarm
You don’t need root permission for that.
But what you get from above could be very confusing to understand. In order to understand that dump completely you should check out morphatic’s answer here.
If you mean by active alarms, the ones in the device’s Alarm Clock Application, I think you can. Try checking out the methods from Here.
However, if you mean that you want to see all alarms created by AlarmManager on your device, then unfortunately you can not do it programatically.
But, you can view the dump data in a text file like this:
adb shell dumpsys alarm > dump.txt