Questions tagged [alarmmanager]

Android class providing access to the system alarm services.

AlarmManager class provides access to the system alarm services. These allow you to schedule your application to be run at some point in the future. When an alarm goes off, the Intent that had been registered for it is broadcast by the system, automatically starting the target application if it is not already running. Registered alarms are retained while the device is asleep (and can optionally wake the device up if they go off during that time), but will be cleared if it is turned off and rebooted.

The AlarmManager holds a CPU wake lock as long as the alarm receiver's onReceive() method is executing. This guarantees that the phone will not sleep until you have finished handling the broadcast. Once onReceive() returns, the AlarmManager releases this wake lock. This means that the phone will in some cases sleep as soon as your onReceive() method completes. If your alarm receiver called Context.startService(), it is possible that the phone will sleep before the requested service is launched. To prevent this, your BroadcastReceiver and Service will need to implement a separate wake lock policy to ensure that the phone continues running until the service becomes available.

AlarmManager reference

4606 questions
21
votes
6 answers

Android Alarm Manager is not working for Flutter Project App

I have installed the Android Alarm Manager plugin in my new Flutter app. I tried using the example code of Plugin, but it gives an error in console. Please suggest how to make the Android Alarm Manager plugin work. How do I integrate Dart's…
Manpreet Kaur
  • 396
  • 1
  • 2
  • 8
21
votes
4 answers

Android AlarmManager triggers every "round" 10 minutes

I use the AlarmManager in my app as follows: alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), AlarmManager.INTERVAL_HALF_DAY, intent); Which I'd expect to trigger the alarm somewhere between 12 and 24 hours from…
Ori Wasserman
  • 962
  • 1
  • 10
  • 24
21
votes
1 answer

Android exact Alarm is always 3 minutes off

I have an app which uses the AlarmManager to regularly wake up the phone at full hour and send a message to an Android Wear watch which than makes a short vibration. I have two users with a Samsung Galaxy S6 with stock Android 5.1.1 and the Sony SW…
shelll
  • 3,234
  • 3
  • 33
  • 67
21
votes
3 answers

Android AlarmManager: is there a way to cancell ALL the alarms set?

I am building an app that set 2 alarms for each day of the week (at a certain hour and minute), the alarms repeat week after week forever. Now the point is: if the user changes the alarms, I will need cancel the previously set alarms. Is there a way…
Lisa Anne
  • 4,482
  • 17
  • 83
  • 157
21
votes
4 answers

Fire notification at every 24 hours and at exact time of 8 AM

I am using AlarmManager() to fire notification and repeat it at every 24 hours. My code is on onCreate() in Splash Activity which fires first when anyone opens App. User can install App at anytime. So I want that when User installs App, It checks…
Jeeten Parmar
  • 403
  • 2
  • 6
  • 16
19
votes
1 answer

Android: Save android.net.Uri object to Database

What i m trying to do is get the selected ringtone from the user, set an AlarmManager alarm to play that ringtone when the alarm goes Off. but I need to save the ringtone in the database so I can reset all the alarms after phone reboot. my question…
Sammy
  • 4,538
  • 8
  • 33
  • 52
19
votes
5 answers

Android Notifications triggered by Alarm Manager not Firing when App is in Doze Mode

I have the following requirements. A user needs to be able to schedule a recurring reminder in my app that will trigger a push notification at an exact time every day. This is one of those questions that I hoped I would end up not submitting as…
pat8719
  • 1,700
  • 1
  • 26
  • 47
19
votes
4 answers

Set Repeat days of week alarm in android

Can somebody give good logic for set repeat days of week alarm? I have done weekly Alarm by using alarmCalendar.set(Calendar.HOUR, AlarmHrsInInt); alarmCalendar.set(Calendar.MINUTE, AlarmMinsInInt); alarmCalendar.set(Calendar.SECOND,…
TheDevMan
  • 5,914
  • 12
  • 74
  • 144
19
votes
2 answers

How to stop an alarm in android

In my main activity which has a button in it. In its onclick listener im calling function to set alarm.The alarm is working but iam not able to stop it .Can some one help me MainActivity.java public class MainActivity extends Activity { …
playmaker420
  • 1,527
  • 4
  • 27
  • 52
18
votes
1 answer

Android - Find out what hour of day it is

I want to use and alarmManager that sets a repeating alarm to go off on the hour, every hour. I know how to set a repeating alarm every hour but not how to actually set it from the top of the hour, I need to know this value for the 'whatTime'…
bobby123
  • 1,006
  • 4
  • 14
  • 24
18
votes
6 answers

How Google calendar or Instagram make their apps all the time up and running even after force stop

Looks like force stop should prevent app from running and it's even disable all app's alarms. However I found that notification in Google Calendar still shown fine even after force stop, and I all the time see Instagram app running, even when I kill…
silent_coder
  • 6,222
  • 14
  • 47
  • 91
18
votes
2 answers

Didn't include a pendingIntent in the extras?

I came across this Error message on Logcat while working on an app. Can anyone tell me what it means? 07-24 23:34:20.288 1140-1140/? E/NetworkScheduler.SchedulerReceiver﹕ Invalid parameter app 07-24 23:34:20.288 1140-1140/?…
Mallock
  • 515
  • 1
  • 4
  • 12
18
votes
9 answers

Android AlarmManager stops when activity die

I start AlarmManager with PendingIntent and on few phones Alarm is not responding. On some devices is working ok on others it fails. I have made a few tests on different phones. Nexus works ok, also Samsung Galaxy S4 zoom (4.2) works ok. Samsung…
5er
  • 2,506
  • 7
  • 32
  • 49
18
votes
3 answers

Service that runs every minute

I have a service that I am wanting to execute a task every minute in the background. It does not need to execute the task whenever the phone is asleep, only when the user is actively using it. I am trying to do this with an IntentService which is…
AggieDev
  • 5,015
  • 9
  • 26
  • 48
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