Questions tagged [android-alarms]

Android alarms is the facility provided by Android through AlarmManager to start an intent at a given time (by passing a pending intent).

Android alarms is the facility provided by Android through AlarmManager to start an intent at a given time (by passing a PendingIntent) which can be used to start an activity or a service or send a broadcast.

AlarmManager Class Reference

1179 questions
94
votes
6 answers

Android: How to use AlarmManager

I need to trigger a block of code after 20 minutes from the AlarmManager being set. Can someone show me sample code on how to use an AlarmManager in ِAndroid? I have been playing around with some code for a few days and it just won't work.
Tom
  • 7,316
  • 9
  • 35
  • 35
57
votes
3 answers

does Alarm Manager persist even after reboot?

I am really new to android, I have been researching about alarms. I want to alarm if there is a birthday on that day. I've have used alarm manager. I was confused because i have read that it clears after reboot. I don't have an android phone so I'm…
Xelamae
  • 603
  • 1
  • 5
  • 8
47
votes
4 answers

Android Set Multiple Alarms

I'm trying to implement an Android app that needs to alarm (or to alert) multiple times along the time. I've already searched, but the nearest I found was a fixed-number of alarms set, and I guess the example didn't work. What I want to know if…
Sammy
  • 767
  • 2
  • 7
  • 25
44
votes
3 answers

Running task periodicaly(once a day/once a week)

I want to run some task (i.e. get my web site news page) periodically (once a week/ a day), even if my application is closed. Is it possible?
siemian
  • 665
  • 1
  • 5
  • 12
37
votes
7 answers

Samsung "App optimisation" feature kills background applications after 3 days

We are currently developing an Android app that is a fitness-tracker application. It runs constantly in the background, and it works fine on most devices, but we've been having issues with the application dying completely on some Samsung devices.…
33
votes
5 answers

Difference between setRepeating and setInexactRepeating of AlarmManager

What are the parameters of the following: alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_FIFTEEN_MINUTES, alarmIntent); And of the following:…
User3
  • 2,465
  • 8
  • 41
  • 84
32
votes
5 answers

Android AlarmManager not working on some devices when the app is closed

I am trying to run IntentService as such from AlarmManager setRepeating() for every half an hour. I want to send a to broadcast, from broad cast to intent service. In the service, some functionality will be done. But, initially the AlarmManager in…
user2601701
  • 347
  • 1
  • 3
  • 6
25
votes
2 answers

Alarm Manager - Scheduling multiple Non-repeating events

In Android Alarm Manager, how can we schedule multiple alarms which are non-repeating and do not have fixed intervals to repeat? I cannot use 'setRepeating' function as the alarms don't have any repeating pattern. I have the alarm times stored in…
inder
  • 551
  • 1
  • 5
  • 9
25
votes
4 answers

Android Alarm Manager setExactAndAllowWhileIdle() not working in Android 7.0 Nougat in Doze mode

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 functionality by issuing a push notification whenever I receive an alarm signal. The problem is: when the…
23
votes
4 answers

Alarm Clock application source code

Is there a way to get the Alarm Application source code for customizing the existing default source code availble in Android 2.3.
Sree
  • 331
  • 1
  • 2
  • 4
23
votes
5 answers

Android 12: Using SCHEDULE_EXACT_ALARM permission to get/show data at specific time are safe in Google Play Policy?

I have an Android app on Play store for 8 years. Recently Google release Android S or 12 introduce some limit with Foreground service launch…
DzungPV
  • 1,561
  • 3
  • 18
  • 24
23
votes
3 answers

Start AlarmManager if device is rebooted

In my app I want to run some code every day at a specific time using an AlarmManager. In the android documentation I found this: Registered alarms are retained while the device is asleep [...] but will be cleared if it is turned off and…
Cilenco
  • 6,951
  • 17
  • 72
  • 152
22
votes
1 answer

Identify and cancel an alarm send to an AlarmManager

If I use the AlarmManager to schedule an alarm (a PendintIntent which should be send), how can I identify that alarm later to cancel it? Can I cancel all alarms scheduled by my app?
cody
  • 6,389
  • 15
  • 52
  • 77
18
votes
1 answer

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…
Victor Basso
  • 5,556
  • 5
  • 42
  • 60
18
votes
1 answer

How to create persistent alarms even after rebooting

Presently, I am working on app that works like "To Do Task List". I have successfully implemented the NotificationService and SchedularService in my application. Also I am getting the alerts(Notifications) at the time set for the tasks. Here are my…
Chintan Soni
  • 24,761
  • 25
  • 106
  • 174
1
2 3
78 79