alarmmanager

Can I wake up my Android when it is unplugged and sleeping?

左心房为你撑大大i 提交于 2020-01-05 01:34:27
问题 I have made an app that allows one to listen to the radio and have implemented an alarm so that I can have the radio play when the alarm goes off. I am using the alarmManager and RTC_wakeup, and it seems to work fine if the phone is plugged in or if the phone is not asleep (which kind of defeats the purpose). When the phone is unplugged and asleep, however, the alarm does not go off until I wake up the phone. Does anyone know a solution to this? 回答1: This is how we did it and it works in both

Alarm manager not starting service as expected after API 23

半世苍凉 提交于 2020-01-03 21:07:25
问题 Recently i have upgraded my project to 26 Api level. after that alarm manager is not working for me. I don't know what's the problem but i guess the alarm is not at all working, whenever app is in background for all device above lolipop(>=M). i have gone through other questions and and have followed some suggestion like 'WakefulBroadcastReceiver', Below is my code and flow of the same Scenario - setting a repeative alarm for every 15 minutes. Intent dil = new Intent(getApplicationContext(),

Scheduling more than one pendingIntent to same activity using AlarmManager

余生颓废 提交于 2020-01-03 17:29:53
问题 Recently I noticed strange behaviour when i tried to schedule Activities to be run in the future using AlarmManager. Look at the code below, the first activity is started in 20 seconds, while the second activity is not started in 40 seconds instead it is started only after 60 seconds. Can anyone explain why the second intent doesn't schedule the second activity to be called instead the third intent does. Does this mean that i can have only one intent for an activity in the AlarmManager. /

Scheduling more than one pendingIntent to same activity using AlarmManager

≯℡__Kan透↙ 提交于 2020-01-03 17:29:15
问题 Recently I noticed strange behaviour when i tried to schedule Activities to be run in the future using AlarmManager. Look at the code below, the first activity is started in 20 seconds, while the second activity is not started in 40 seconds instead it is started only after 60 seconds. Can anyone explain why the second intent doesn't schedule the second activity to be called instead the third intent does. Does this mean that i can have only one intent for an activity in the AlarmManager. /

Alarm Manager not firing when app is killed on Android 7 (One Plus 3T)

冷暖自知 提交于 2020-01-03 07:26:08
问题 Since the introduction Doze Mode and App StandBy managing alarms have changed. The problem I'm facing is my alarm manager fires correctly on KitKat, Lolipop and Marshmellow devices but above API 23 it does not fire unless the app is in foreground or background. But if the app is killed, the alarms are stopped. Checked out Google Keep Application on my Android 7, turns out it does the same. But Google Calendar fires regardless of whether the app is killed or not. Done some reading and found

How to run some task at specified time interval in android using AlarmManager?

我与影子孤独终老i 提交于 2020-01-03 05:17:11
问题 Hello stackoverflow I'm trying to develop an android application that can run some task at specific time interval, I'm using AlarmManager to do the task, the code snippet is as follows, if (radioBtnChecked) { MyActivity.this.alarmMgr = (AlarmManager) MyActivity.this.getSystemService(Context.ALARM_SERVICE); Intent serviceIntent = new Intent(MyActivity.this, MyService.class); MyActivity.this.pi = PendingIntent.getService(MyActivity.this, 0, serviceIntent, 0); MyActivity.this.alarmMgr

AlarmManager Stops after removing app from recents apps

廉价感情. 提交于 2020-01-02 20:44:20
问题 I am new to this part of android, and here I aim to use alarm manager to run a code snippet every 2 minute which will poll a server (using the website's api) and based on the returned JSON generate notification. After a looking up the web I thought one of the best option in my case will be using intent service and android. Manifest of Services and Recievers <service android:name=".NotifyService" android:enabled="true" android:exported="false" > </service> <receiver android:name=".TheReceiver"

Android : AlarmManager fires off for past time

做~自己de王妃 提交于 2020-01-02 14:51:23
问题 This is my code for alarm manager: Intent intent=new Intent(getBaseContext(),AlarmReciever.class); intent.setAction("com.example.projectx.ACTION"); PendingIntent pendingIntent=PendingIntent.getBroadcast(this,12345, intent,PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager alarmManager=(AlarmManager)getSystemService(Activity.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP,targetCal.getTimeInMillis(),pendingIntent); The code works great if i select the alarm to fire off at a future hour

Why is my AlarmManager firing off instantly?

荒凉一梦 提交于 2020-01-02 08:25:33
问题 I'm trying to build an alarm application. I had the alarm working before and I was able to set the different times and the alarm would go off appropriately. I then changed the layout of the ChangeAlarmActivity to a TableLayout and now it won't work? I didn't touch the code. Here is how I set the alarm: Intent alarmIntent = new Intent(ChangeAlarmActivity.this, AlarmReceiver.class); PendingIntent pendingAlarmIntent = PendingIntent.getBroadcast(ChangeAlarmActivity.this, (int)alarm.getID(),

Android alarmmanager not being very reliable

為{幸葍}努か 提交于 2020-01-02 06:58:29
问题 I am having a problem with the Alarmmanager functions for the Android. The problem is alarms that have over an hour or so to wait fail to go off. My application initially creates an alarm like so:- PendingIntent sender = PendingIntent.getBroadcast(this, 192837, intent, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, mCal.getTimeInMillis(), sender); When the alarm goes off it triggers my RecieverHandler class