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

1165 questions
13
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…
Vituel
  • 4,708
  • 5
  • 37
  • 52
12
votes
3 answers

Alarm Manager does not work in background on Android 6.0

This is my Activity code, Long time = new GregorianCalendar().getTimeInMillis()+20000;//Setting alarm after 20 sec Intent intentAlarm = new…
12
votes
3 answers

How to show a notification everyday at a certain time even when the app is closed?

Although this question might have been asked before on Stack Overflow, I still haven't found a clear answer. I want to show a notification everyday at 12pm for example even when the app is closed. I have referenced from those links: Notifications in…
12
votes
2 answers

Set alarm from Android 4.4 Kitkat

In Android 4.4 APIs page I read: When you set your app's targetSdkVersion to "19" or higher, alarms that you create using either set() or setRepeating() will be inexact. [CUT] This inexact batching behavior applies only to updated apps. If…
crbin1
  • 2,201
  • 3
  • 20
  • 29
11
votes
3 answers

Programmatically turn screen on in android

I am developing an alarm application. From the main activity i set the alarm using broadcast. Then in onReceive in broadcast receiver i call activity that is enabling user to shut down or snooze the alarm...In that activity, in the beginning of…
user1177122
  • 115
  • 1
  • 1
  • 6
11
votes
1 answer

Firebase firing too many alarms

I already have an alarm that fires daily which has FLAG_UPDATE_CURRENT. This is the log from developer's console. java.lang.SecurityException: !@Too many alarms (500) registered from pid 32326 uid 10206 at…
mjosh
  • 11,865
  • 7
  • 39
  • 72
11
votes
1 answer

Android - Repeating Alarms Allowed While Idle

I need to set a repeating alarm every X hours that would even fire in doze mode. However, the only Apis available in AlarmManager for Android 23 are setExactAndAllowWhileIdle and setAndAllowWhileIdle which are not for repeating alarms. I am…
11
votes
3 answers

Repeating Alarm for specific days of week android

In my application I have a functionality to trigger alarm in 4 senerios: Only once for a user chosen date and time Daily for chosen time Weekly according to chosen date and time User chosen custom days of the week I successfully implement the…
Dhruvil Patel
  • 2,836
  • 2
  • 20
  • 39
11
votes
3 answers

part-1 persistent foreGround android service that starts by UI, works at sleep mode too, also starts at phone restart

Status:--- I equally accept Karakuri's and Sharad Mhaske's answer, but since Sharad Mhaske answer after the start of bounty, the bounty should go to him. Part-2 made: part-2 persistent foreGround android service that starts by UI, works at sleep…
10
votes
2 answers

Alarm Manager issue in Android 6.0 Doze mode

I've made an app that always worked until Android 6.0. I think it's the Doze feature that it's not allowing my Alarm to fire. I use sharedpreferences to handle the options: //ENABLE NIGHT MODE TIMER int sHour =…
10
votes
1 answer

Lollipop API for controlling the Alarm icon in status bar

This is a Lollipop-specific question, since the API has changed. To find out how to do this on earlier versions, see related question: Controlling the Alarm icon in status bar I would like to know how to turn on / off the system Alarm icon in the…
10
votes
2 answers

Do Android AlarmManagers continue to run after an app update?

From what I can see, if you schedule an indefinitely repeating alarm it won't stop running until you reboot your device or uninstall the app. I was wondering, how do these behave in the event of an app update? i.e. you download version 1 of the app…
brent777
  • 3,299
  • 1
  • 24
  • 33
10
votes
5 answers

detect default alarm clock application alarms

I would like to know if there is a way (probably a system broadcast) to know that the alarm clock default application is now start ringing. if not - I'll be satisfied also if I could get progrematically list of all active alarms been set by the…
Tal Kanel
  • 9,855
  • 10
  • 55
  • 93
10
votes
1 answer

How to set timer to call a function every n minutes?

I want to set up a timer in an Android application that will call a function after every 15/30/45 and n minutes when user login. But also it will stop timer when user log off. and timer begin from start if user login again. I want that…
Shweta
  • 1,075
  • 5
  • 17
  • 34
10
votes
2 answers

difference between RTC and RTC_WAKEUP in android

i am new to android i have to perform some operation after every 30 min whether my application is running or not so i want to how to perform these operation using service and alarm manager any example or running will be helpfull
CodingRat
  • 1,900
  • 3
  • 23
  • 42
1
2
3
77 78