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
17
votes
2 answers

Android start running JobScheduler at specific time

I want to start a JobScheduler at a specific time everyday, and finish it after 3 hours. I have the part of triggering the job every 20 min, and for 3 hours, but in JobInfo.Builder class there's no option for starting the job at an exact…
Dus
  • 4,052
  • 5
  • 30
  • 49
16
votes
1 answer

How can I set exact, repeating alarms in Android 4.4?

Right now, I am setting alarms like this: AlarmManager manager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(context, AlarmReceiver.class); PendingIntent pendingIntent =…
Kala J
  • 2,040
  • 4
  • 45
  • 85
14
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…
14
votes
5 answers

Android Galaxy S4 -- Activity that is visible over lock screen

A few years ago, I wrote an alarm app that worked on Android 2, and I'm now trying to upgrade it to work on Android 4. Specifically, on the Samsung Galaxy S4. On Android 2, if the phone was sleeping, it would wake the phone up and display a "Snooze…
13
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…
13
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,910
  • 2
  • 22
  • 39
13
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
1 answer

Gradle build failing due to keystore.properties file missing

I'm trying to use this alarm app on Android Studio - https://github.com/philliphsu/ClockPlus . However, gradle build is failing (error message below). Please let me know what needs to be fixed for this to…
lovetocode
  • 121
  • 1
  • 1
  • 5
12
votes
1 answer

android prevent immediate trigger of alarm service if alarm time has passed for the day

The reference for Alarm Manager says that If the stated trigger time is in the past, the alarm will be triggered immediately. I am facing this problem in my application. Here is my alarm manager code : Intent myIntent = new…
Flame of udun
  • 2,136
  • 7
  • 35
  • 79
12
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,369
  • 1
  • 26
  • 35
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,219
  • 3
  • 22
  • 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…
mihirjoshi
  • 12,161
  • 7
  • 47
  • 78
11
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 =…
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…
1
2
3
78 79