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

How come this alarm isn't going off?

I'm trying to set an alarm for a particular date and time but so far I've been unsuccessful. As an experiment I'm trying to set it for 10:04am today like so: Calendar cal = Calendar.getInstance(); // int currtYear = cal.get( Calendar.YEAR…
Katana24
  • 8,706
  • 19
  • 76
  • 118
-1
votes
1 answer

Options for keeping device awake while a short-lived service runs

I'm developing an application that takes the user through an exercise plan. It's a running trainer that uses audio cues to let the user know when to walk, run, etc. at different points during their exercise. It's very likely that the phone will be…
Matt Gibson
  • 37,886
  • 9
  • 99
  • 128
-1
votes
2 answers

Setting alarm clock to be shown in Clock application

Is there way to set up alarm clock in my application - this means that when I use something like AlarmManager or else, my new alarm would be visible on my alarm list in stock Clock application. I read some tutorials and did some but none has managed…
Tomi S
  • 197
  • 1
  • 6
  • 17
-1
votes
1 answer

Android: Read Gmail Message Body From a Service with Gmail api

What I want that, from a service, I want to read the gmail message body when a gmail notification has arrived. When The Gmail Notification has arrived an alarm will occure and I get the full body text in alarmReceiver. I got the android quick…
Noor Hossain
  • 1,620
  • 1
  • 18
  • 25
-1
votes
1 answer

Notification not coming up

I am trying to make an android reminder app. where i am trying to show notification on a particular time. I have seen a video on youtube and followed it perfectly. yet, my code is not working. Also, android studio is showing no errors. The problem…
-1
votes
2 answers

Custom notification at user date and time

I have to show notification to user at user's selected time and date and my code is below. public static void setAlarm(Context context, long id, int rYear, int rMonth, int rDay, int rHour, int rMinute) { if (Share.wantReminder) { …
-1
votes
1 answer

AlarmManager cancel() does not stop my Alarm

I'm creating the alarm with this code when my widget is added to screen: alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(context, WidgetAlarmReceiver.class); …
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
-1
votes
2 answers

How to notify user with alarm when app is not running?

I have an app where I want to set alarm on specific date and time . Let say 5:00pm of 16 march. I want this alarm to be schedule as non repeating alarm. Now the alarm is setting and working. but it is only working when App is working or in…
Android teem
  • 780
  • 2
  • 13
  • 36
-1
votes
1 answer

Alarms getting deleted when re-running my application

In my application, I am setting Alarms and is working fine.when I am trying to install the code again without uninstalling the previous package my alarms are being deleted.I would like to restore my alarms until unless I delete alarms. I have come…
sudha
  • 193
  • 13
-1
votes
1 answer

Can't cancel AlarmManager because it's instance is null after some hours

I was implementing an AlarmManager with an Intent which tryes to connect to a server each 30 minutes until the server has return 200. if (resultCode != 200){ alarmMgr = (AlarmManager)…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
-1
votes
2 answers

Alarm everyday at 5AM morning

I am working on an android application where I need to trigger an alarm every morning at 5 am. I have already used the concept of Intent(below is the code) and putting AlarmManager in the Service. But I didnt get the problem solution from both…
sagar suri
  • 4,351
  • 12
  • 59
  • 122
-1
votes
1 answer

Proper way of running IntentService every x minutes in android, doze included

Basically I am stuck because the "improvements" in battery added in Android 6.0+. My app is supporting API from 11+ Scenario Here's my scenario: my app fetches data from a web service of a 3rd party server. Since it is not my server I do not have…
Alin
  • 14,809
  • 40
  • 129
  • 218
-1
votes
1 answer

Alarm is getting killed with app

This is becoming unreal how much an alarm will not work. I am having 2 issues with Android killing my app and as such everything stops even though everything i read says it should work. My AlarmManager item dies when i Greenify my app, Greenify to…
-1
votes
1 answer

Android finish() method is not closing the app but minimizing it

I'm starting an activity from the background service by using following piece of code: Intent intent = new Intent(getApplicationContext(),AlarmActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); But when I…
-1
votes
2 answers

BroadcastReceiver fires with a delay

I have a TimePicker and a Button and I want to set an alarm when the user clicks on the Button at the time specified. It gets the hour well when I click on the button but the alarm is being fired sometimes at the specified time, but not always. It…
Francisco Romero
  • 12,787
  • 22
  • 92
  • 167