FAQ Database Discussion Community


Android AlarmManager Pass extra from activity to service

android-service,android-notifications,android-pendingintent,android-alarms
I have tried to follow many links but no matter what my extras keep being null. First I have an activity (MainActivity) that will set up a notification using a service (NotifyService). I can get the service to be and the notification to appear at the appropriate time. However passing...

Running Frequently task using AlarmManager

alarmmanager,android-alarms
I want to run some task in background without telling user, to send some data to server. Requirement is, after every fifteen minutes I have to send some data. So need Alarm Triggered after every 15 Min. I am using AlarmManager but not achieving. Calendar cal = Calendar.getInstance(); cal.set(Calendar.HOUR_OF_DAY,5); cal.set(Calendar.MINUTE,10);//...

How do I set notification in android application at specific time?

android,android-intent,android-activity,alarmmanager,android-alarms
I have used following code in android application to set up Notification(Alarm) using AlarmManager. public void setAlarm() { Intent intent = new Intent(MainActivity.this, TimeAlarm.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), (40000), pendingIntent); } Or should I use following code Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MONTH, 3); calendar.set(Calendar.YEAR, 2015);...

Canceling Android Alarms / Notifications

android,android-service,android-notifications,android-pendingintent,android-alarms
I have an app that notifies you if you have any bills to pay. I want one notification for each bill due. The alarm is set to go off at an exact time in the day. I have everything working except for one aspect: The alarm goes away after I...

Delete a pending alarm / notification from service

android,notifications,alarmmanager,android-alarms
I have an activity that calls a Helper, where I create a notification what will pop-up in a selected time. It works great. I want to create another function in a different activity that can delete a pending alarm before the notification pops up. I tried many ways I found...

Will Intents started by AlarmManager retain its objects between runs?

java,android,android-intent,android-broadcast,android-alarms
I have an app that uses an AlarmManager to do a task regularly. From the Intent that is called by the AlarmManager I access the application to get access to shared data. Application foo = getApplication(); I then use the foo object both for reading and writing data. Most of...

AlarmManager with flag AlarmManager.INTERVAL_DAY is executing in the current day, not in the next day

android,push-notification,alarmmanager,android-alarms
I need to add push notifications in my Android application. The notification must be shown every day at certain time (for example at 1 PM). To do this i am using an AlarmManager. I am registering an alarm, when the app is starting for the first time. But i got...

Lollipop API for controlling the Alarm icon in status bar

android,alarmmanager,alarm,android-alarms,undocumented-behavior
This is a Lollipop-specific question, since the API has changed. To find out how to do this on earlier versions, see related question: Controlling the Alarm icon in status bar I would like to know how to turn on / off the system Alarm icon in the status bar as...

Scheduling repeating alarms

android,alarmmanager,android-alarms
I'm scheduling repeating alarms in order to execute service one a period of time. // Set the alarm to start at approximately 24:05 a.m. Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.set(Calendar.HOUR_OF_DAY, 24); calendar.set(Calendar.MINUTE, 5); alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, ); Some question about the implementation : What happens if user delete the application...

How to create alarm with date, time and repetition for some days(suppose 10 days) which show alert even the phone is reset or lock?

android,broadcastreceiver,alarmmanager,android-alarms,repetition
I am creating a reminder application for that i want to create a alarm with date time and number of days repetation. As i am new in android development can any one please help me with this? I have check this link...

WakefulBroadcastReceiver doesn't receive PendingIntent from AlarmManager

android,broadcastreceiver,alarmmanager,android-pendingintent,android-alarms
I'm struggling on an app that must repeat a task with a specified interval. I want it to wakeup the device if needed. I have no idea why, but the WakefulBroadcastReceiver NEVER executes its onReceive method that should be triggered via AlarmManager. The problem persists with a normal BroadcastReceiver. I'm...

snooze functionality using spinner

android,android-activity,android-spinner,android-alarms
I am developing snooze functionality for alarm app, i am using spinner for selecting snooze mins, by default it is selecting as first array int value, but alarm is not rising on snooze time. by default it should not select any value, user need to select. is there any other...

“Unable to create service” error on alarm set

android,android-intent,android-pendingintent,android-broadcast,android-alarms
I have a problem when i'm trying to set an alarm : My service "SetNotifications" is called by a broadcast receiver called "BroadcastReceiverCalendar". The service "SetNotifications" set multiple alarms. My application crash on the last line, see error code bellow. Here is the code of my alarm setup : Intent...

AlarmManager or CalendarProvider, What should be used for an app like Keep or Evernote?

android,alarmmanager,android-alarms,android-calendar,repeatingalarm
I am developing an android application just like Google Keep and Evernote. Now I want to add many reminders or alarms one time and repeated too. I have both options and I am confused.

Android set session expired to all activities at once

android,session,alarmmanager,session-timeout,android-alarms
I have a method that checks if the user has internet connection, and if he doesn't he has 24h to get online again, if not the app should stop and take the user to the login activity, it is working, but the problem is, I'm calling this method in the...

Alarm stop's when snoozed

android,android-activity,android-alarms
This is the alarm activity, on alarm set Two CAncel and Snooze, Default snooze kept as 4 Seconds, This is working fine when we kept alarm, but when click snooze it alarm stops unfortunately on snoozed time. public class AlarmAlertActivity extends Activity implements OnClickListener { private Calendar alarmTime = Calendar.getInstance();...

Setting an alarm based on date in database

java,android,date,calendar,android-alarms
I found a tutorial that helped me get a working alarm setup but in the tutorial we used a date picker to set the time of the alarm. All was going well, so I attempted to replace the date picker with a method of my own and set the alarm...

Broadcast receiver in a service doesn't receive alarm signal

android,android-intent,android-service,android-broadcast,android-alarms
Here is my problem, I have a service started on boot or on the launch of the application, this service start an alarm which download a file every x minutes. The problem is that the broadcast receiver doesn't seems to receive anything. here is the concerned code: @Override public int...

getting location updates with background service

android,android-service,android-location,android-alarms,android-googleapiclient
i have just started to learn how to use services, and i am trying to build an app which sets off an alarm when the device is in a certain distance from a location that the user defined. i read a couple of tutorial and wrote this: package com.example.fgps; import...

The method startActivityForResult(Intent, int) is undefined for the type ABC

android,android-layout,android-image,android-alarms,android-layout-weight
i have a class ABC with implements Serializable ABC class is an alarm class so using bunch of functions, i just wanted to upload image from SD card, to that i need to view images in GRIDVIEW then user need to select the IMAGE, this is the process i have...

Android App is asking to share Bug report? Why is this?

android,android-alarms
I just learned Android from scratch and built an app with simple process using Android Studio. The app has one process with repeating Alarm manager which will toast a message after 10 mins. That's it. However, once I install it on a real device, after an hour or so, the...

How do I configure my AlarmReceiver to actually trigger at my desired interval?

android,android-intent,alarmmanager,android-alarms,repeatingalarm
The goal for this portion of my app is to run a repeating alarm in the background at all times that grabs a new prediction every 15 minutes from a server side machine learning algorithm, updating the app. I currently have the skeleton for this desired behavior implemented, to make...

Change the length of the Android Alarm

android,clock,alarm,android-alarms
The android alarm duration is basically at 1min (I think). I would like to change it, so I can set the length/the duration at 4min for exemple (the duration of a song). Can you tell me which methods I can call to change it ? Can you guide me please...

How to set a reliable long-term alarm in Android?

android,cordova,phonegap-plugins,alarmmanager,android-alarms
I'm developing an Android app with Phonegap. I need to set a long-term alarm to remind users things like a monthly task. I was searching plugins for this, but the most popular plugin that I found it doesn't have enough reliability. I've tried to use it, but it only works...

alarm is getting fired today at 12 AM rather then after 48 hours

android,android-alarms
i am firing my alarm at 12 AM midnight after every 48 hours (i.e. two days). here is my code Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.set(Calendar.HOUR, 12); // MIDNIGHT 12 AM calendar.set(Calendar.MINUTE,00); calendar.set(Calendar.SECOND, 00); calendar.getTime().toString(); dayAlarmMgr.setRepeating( AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY * 2, // EVERY TWO DAYS dayAlarmIntent); now when i run...