Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug which AlarmManager alarms are running from your application?

We have a few repeating alarms setup and they work normally most of the time. Sometimes though they get stuck (probably canceled somehow). How to debug it to make sure an alarm is actually off when it seems stuck?

Regarding the reasons for the alarm to be cancelled: I'm aware it happens when the user force stops your app from Applications Manager. Can the system also randomly cancel it? (say when killing your whole app to reclaim resources?)

like image 913
Victor Basso Avatar asked Nov 19 '13 14:11

Victor Basso


People also ask

How do you schedule notifications using alarm Manager explain with an example?

Handling the broadcast:Alarm service will invoke this receiver on scheduled time. Here we can trigger the local notification with the respective details(title, content, icon). The below code will help you to handle the broadcast. Now inside your onReceive() function, you need to initiate the notification.

Is AlarmManager deprecated?

IntentService + WakefulBroadcastReceiver + AlarmManager are deprecated with API 26 (Android 8.0 Oreo).

What is Samsung alarm Manager?

AlarmManager is a bridge between application and Android system alarm service. It can send a broadcast to your app (which can be completely terminated by user) at a scheduled time and your app can then perform any task accordingly.


1 Answers

Regarding debugging the alarms:

adb shell dumpsys alarm

I still haven't figured out if alarms can be killed other than by a force stop by the user.

like image 133
Victor Basso Avatar answered Oct 21 '22 15:10

Victor Basso