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
1
vote
0 answers

Android: Forcestop on my Lenovo API 23 device disables Broadcasts - is there a way to work around this?

i have Broadcasts set up via AlarmManager and they are registered in the Manifest, so they can run even if the App is not running. On my API 26 Emulator everything works fine, not matter if i close the App in the TaskManager or not. However, on my…
1
vote
0 answers

Common events that will cancel a recurring alarm

I was wondering what some common events were that would cancel a recurring alarm. I am catching them so I can reset the alarm when needed. What are some other common one's that I may not be handling? Here is what I am currently…
ninjasense
  • 13,756
  • 19
  • 75
  • 92
1
vote
1 answer

Pass an Object with Intent using AlarmManager - receiver getting null object

Hi I am trying to attach an Object while set AlarmManager by using the below code, try { int when = (int)testDate.getTime(); Intent intent1 = new Intent(mEventService, AlarmReceiver.class); Bundle bundle = new…
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
1
vote
1 answer

android:AlarmManager doesn't fire alarm events

I'd like my app performs some work periodically.To do it I'm using AlarmManager but for some reason it doesn't fire any events. Manifest xml:
undefined
  • 623
  • 7
  • 27
1
vote
0 answers

set an Alarm before App is Killed?

So far i have tried to start a service on app-start and have Alarm Setup code in onTaskRemoved Method when app killed the onTaskRemoved invokes and the alarm should scheduled & Fired but its not happening in my case. public void onTaskRemoved(Intent…
Kunal Awasthi
  • 310
  • 2
  • 14
1
vote
2 answers

Alarm Notifications not appearing

I'm having some trouble with getting a daily notification appearing. My application gets a time, a hour and minute that the user wishes to be reminded of something. I then use AlarmManager to set up a alarm at this time repeating whilst using…
ZarifS
  • 467
  • 1
  • 11
  • 20
1
vote
2 answers

why i am getting SoketTimeOutException in sleep mode of device?

I am calling a web service HTTPS connection from Service class which is called by alarm manager in every 1 min.When i start service it is working fine i am getting response from web service until device gets in sleep mode.when device's screen gets…
shyam002
  • 237
  • 1
  • 5
  • 19
1
vote
0 answers

Why android.intent.action.TIME_SET calls my BroadcastReceiver onReceive multiple times

1) android.intent.action.BOOT_COMPLETED is working fine it calls the broadcast onReceive only once 2) android.intent.action.TIME_SET is calls the broadcast on multiple times when user manually changes the time it calls the broadcast onReceive…
Sarath Kumar
  • 1,922
  • 3
  • 19
  • 43
1
vote
2 answers

Keep both pendingIntents with the same requestCode

I am developing an alarm application in Android. The flow is really simple, Im just creating a PendingIntent and then I call the setExact() method in the AlarmManager much like below. Intent myIntent = new Intent(context,…
Libathos
  • 3,340
  • 5
  • 36
  • 61
1
vote
1 answer

PendingIntent fires when the alarm time is a multiple of 1 hour away from real time - Android

I am creating an Alarm clock app. I can set PendingIntent's, cancel them, and receive them using my BroadcastReceiver when the time that I set using AlarmManager is reached. I discovered a recent problem however. Previously, I have been able to set…
Michael
  • 3,093
  • 7
  • 39
  • 83
1
vote
0 answers

Firebase Jobdispatcher interval unreliable

Google forces me to stop using the AlarmManager because of Excessive Wakeups. I should now use JobScheduler, but my app should support older devices with API <21. So I have to use the Firebase JobDispatcher :-( However, in my opinion, the…
almisoft
  • 2,153
  • 2
  • 25
  • 33
1
vote
0 answers

BroadcastReceiver is not working properly while in others it does

i am making an app that required to inform the user with a notification when a specific date is approaching. I use a Client class as a 'middle man' between activity and a Service. Once i bind the service, i call a method that interacts with…
1
vote
0 answers

Scheduling a daily repeating alarm in Android

I would like to schedule a repeating alarm daily in android, I was able to get this done partially in which alarm only triggers once and never get to repeat daily, Here is the my code snippet /* Schedule the alarm based on user preferences…
Delaroy
  • 55
  • 2
  • 9
1
vote
2 answers

how to schedule efficiently a task in my service?

I have a service that collect data, and every hours the service need to send this data to my server. I know their is plenty of solutions available to schedule task, but in my case what will be the most efficient regarding battery consumption and…
zeus
  • 12,173
  • 9
  • 63
  • 184
1
vote
0 answers

How can I cancel the alarm when I click at a specific position in listView

My app let the users create 4 alarms and display 4 alarms on the listView, the alarms can be deleted when users click on the item in listView, but It doesn't simple than I think. All i need to know is how can I cancel the pendingIntent in…
1 2 3
99
100