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

AlarmManager.SetRepeating not working properly

I'm trying to call a thread regularly through the AlarmManager. Problem is, after the given period the OnReceive() gets called two times (why?) and then never again. What am I doing wrong here? I'm working with Xamarin (C#) for Android on API level…
AllRight
  • 175
  • 1
  • 11
2
votes
1 answer

Multiple alarms at the same time in Android

I'm stuck on this problem. I've read many solutions on stack overflow but none of these have solved my problem. Here's my code: In my Main Activity, I wrote this-- this.context = this; Intent alarm = new Intent(this.context,…
2
votes
1 answer

how to receive alarm service extending main activity

I need help in receiving an alarm service. Its not that easy as it seems as i need not only the variables but data to pass on to the onReceive Heres the broadcast receiver which is IN THE MAIN ACTIVITY. i created a class inside the main activity so…
user5912746
2
votes
1 answer

Alarm app is not accurate

I m creating an Alarm app for android and for some reason there is always something like 20-60 sec delay in my alarms. I have no clue why is it happening as i m using the setExact() method for API 19+ My code: private void setAlarm() { if…
Yogurt33
  • 75
  • 1
  • 6
2
votes
0 answers

Android alarm fails to start

I want to set an alarm to a given time of the day, to work some logic at that time. Here is my code for this end: //Create alarm manager AlarmManager alarmMgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE); //Create pending intent &…
Dan The Man
  • 1,835
  • 6
  • 30
  • 50
2
votes
0 answers

Creating Alarm from Alarm Receiver

I have created following class: AlarmReceiver.java public class AlarmReceiver extends BroadcastReceiver { NotificationManager mNotificationManager; @Override public void onReceive(Context context, Intent intent) { if(Schedule.alarmSetOn){ …
Harshil Pansare
  • 1,117
  • 1
  • 13
  • 37
2
votes
1 answer

Alarm preventing activity from finish

I am using Alarm service in an Android application and here is the code snippet for same Creation of Pending Intent Intent intent = new Intent(context, UninstallService.class); intent.putExtra("APPLICATION_PREFERENCE",…
CuriousMind
  • 3,143
  • 3
  • 29
  • 54
2
votes
0 answers

I am trying to create an Alarm on my Android Studio 1.4

Trying to create a simple Alarm. Reading through the article of Android Dev here http://developer.android.com/reference/android/provider/AlarmClock.html I get an idea that the Alarm should go off even when the application is not running and the…
JaunC
  • 21
  • 1
2
votes
0 answers

How to set alarm between two dates in Android?

I want to set alarm between two dates. For example date1 = 02/12/2105 and date2 = 21/12/2015 alarm should fire every day between date1 and date2 I have tried using below code private void setAlarm(Calendar targetCal){ Intent intent = new…
Arya
  • 21
  • 3
2
votes
1 answer

Cancel android pending intent

i have come across multiple solutions on how i can cancel a pending intent however have come to no avail. I have also been unable to trigger the cancellation in which the codes i have placed in an on-click function. The button triggering the…
2
votes
0 answers

How does Calendar.add work around Daylight Savings time?

I'm working on an alarm clock app for Android. I'm doing all of my scheduling and timing using the Calendar class. I'm curious how Calendar.add will respond if the current time is before Daylight Savings Time takes effect but the add will push it to…
Corey Ogburn
  • 24,072
  • 31
  • 113
  • 188
2
votes
1 answer

Android set repeating task at same time everyday using AlarmManager

Have to schedule an event at 8 pm (the clock shows 8 pm) everyday irrespective of the user moving across different timezones. Set repeating with interval of one day will not deliver it at the correct time. How to approach this? This is the closest…
Srinivas
  • 332
  • 4
  • 18
2
votes
2 answers

Android-Multiple Alarms with different timings fires at wrong time

I have four Repeating Alarms in my app each of which fires at different timings to do some important tasks. They are Alarm 1 - 12:30 AM Alarm 2 - 01:00 AM Alarm 3 - 06:00 AM Alarm 4 - 12:15 PM Every alarm fires no problems. Time interval for each…
2
votes
1 answer

AlarmManager instead of Background Service? for repeated tasks

Services can always be shut down by the OS. As such they seem less reliable to me than an AlarmManager. I have to do periodic updates every 1-2 seconds. Is it better to use background thread in a service or AlarmManager. Since there are ways to…
MuayThai
  • 441
  • 1
  • 5
  • 19
2
votes
1 answer

Why Notification repeats?

I have an app that uses AlarmManager broadcast receiver, and start notification. Everything was good until (I don't know until, I just observed it). When I start alarm in certain time, everything works good, but notification repeats several times. I…