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
3
votes
1 answer

Android AlarmManager.setExactAndAllowWhileIdle() alarms not fired after certain time working

I am using AlarmManager to set 2 different repeating alarms. One alarm is fired every hour at minute 59. This alarm always works correctly. But, the other alarm, which is scheduled every 5 minutes starts working properly during 1 or 2 hours. After…
3
votes
2 answers

Oreo: Alarm is not fired when Application is not running

I have relatively simple setup that should trigger an alarm at certain time of the day and show a notification to user. here is relative code, Setting the alarm long inTime = /*expirationTime*/ Calendar.getInstance().getTimeInMillis() + 10000; …
Ankit
  • 429
  • 3
  • 16
3
votes
1 answer

Confused in choosing between Firebase JobDispatcher vs AlarmManager

I am creating a alarm like application where user can add a remainder for particular date and time, they can also choose repeat to repeat the remainder. And I don't do any network specific job in remainder. But in future I may need to use the…
3
votes
1 answer

Sometimes alarms doesn't get triggered using AlarmManager

I have a reminder app which notifies the user for a specific task. Everything is working as expected, but sometimes the alarm doesn't get triggered. This issue was reported by nearly 100 users. I suspect that when the devices are in sleep mode, the…
Zbarcea Christian
  • 9,367
  • 22
  • 84
  • 137
3
votes
0 answers

How to bypass Doze mode and batching at the same time using AlarmManager?

I'm trying to deliver notifications in my app at specific times. I know about Doze and how nothing bypasses its restrictions except AlarmManager.setAlarmClock() because even even setExactAndAllowWhileIdle is not really exact. I really hoped I could…
Sazbak
  • 189
  • 1
  • 14
3
votes
1 answer

Alarm Manager is not triggering on some devices?

I am setting AlarmManager for scheduling local notification. I have tried many different solution like this, but all in vain. That answer suggest me to use setExact() and setExactAndAllowWhileIdle() methods for different version of apis code sample…
rana_sadam
  • 1,216
  • 10
  • 18
3
votes
1 answer

Is it bad practice to store PendingIntent's in an object for later retrieval to cancel an Alarm?

I'm making an alarm clock app using PendingIntent and AlarmManager. I know in order to cancel a PendingIntent, you need to recreate it exactly. In my app, much like many other alarm clock apps, there is a list of alarms with a switch to toggle each…
Michael
  • 3,093
  • 7
  • 39
  • 83
3
votes
2 answers

Android cannot pass intent extras to AlarmManager

I thought this would solve my problem, but it doesn't. I have this code to send my alarm: public void triggerAlarm() { AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(ALARM_SERVICE); alarmManager = (AlarmManager)…
3
votes
2 answers

Android repeating alarm, override self on each open

I have the below alarm that gets run from the MainActivity on app launch. I think I have programmed it to override itself on each new app launch. But I am finding it hard to test. Is this indeed overriding itself OR if I close and open the app a…
Rob
  • 6,758
  • 4
  • 46
  • 51
3
votes
0 answers

Schedule start and stop of a service at specific times

My app is doing Human Activity Recognition and notifying the user if they are not active enough. I am reading the accelerometer's data in an always running foreground service. At the moment I am trying to start and stop the service when the user is…
Georgi Koemdzhiev
  • 11,421
  • 18
  • 62
  • 126
3
votes
1 answer

AlarmManager and WakefullBroadcastReceiver how private are the passed Extras?

I am trying to implement some alarm scheduling by using AlarmManager. Since when a alarm is triggered, I want to use a WakefulBroadcastReceiver which starts an IntentService to do some background job. I have some questions related to…
Alin
  • 14,809
  • 40
  • 129
  • 218
3
votes
1 answer

Best way to set repeating task

i have a method in my app that i want to be called repeatedly depending on what the user chooses. like if every hour is chosen by the user, the activity fires a method that is being called every hour. i would like to know the best way to schedule…
irobotxx
  • 5,963
  • 11
  • 62
  • 91
3
votes
3 answers

Schedule daily alarm after app install

I want to execute a BroadcastReceiver once a day. Scheduling an alarm when the device boots works well, but it requires the device to be rebooted at least once. How can I schedule the alarm right after app install (and still persist the scheduling…
sdabet
  • 18,360
  • 11
  • 89
  • 158
3
votes
3 answers

android alarmmanager alarms after reboot 2016

I making a app, where you can set alarms. For example, I have class on Mondays at 7o' clock, so I need to start the alarm every Monday, but also I have another class on Tuesday and have to do it the same. I already can do that and works, with an…
fer
  • 87
  • 2
  • 9
3
votes
1 answer

extra doesn't pass through intent

I'm trying to pass Alarm_no to alarm_Time.java, and when alarm is started I can cancel it and get the Alarm_no through intent the alarm is canceled but the Alarm_no doesn't pass, and the pending_intent is null, I don't know why and how to fix…