alarmmanager

Did I screw up my System_server service?

荒凉一梦 提交于 2019-12-06 09:49:48
My phone is producing a non-stop Log.d output. The following repeats over and over again about 1200 times per second . 04-25 15:58:04.883 1542-5012/? D/NetworkStatsCollection: getHistory:mUID 10266 isVideoCallUID: false PID 1542 is System_server which I've come to understand manages an array of Android services. In the app I'm developing, I use the Alarm Manager and Notification service as seen below. Is there anything I could have done to cause this service to react the way it is? public void scheduleNotification(Context context, long alarmTime, int notificationId, String setOrCancel) {

Android: AlarmManager used to call a Service to notify the user

≡放荡痞女 提交于 2019-12-06 08:36:28
Edit Adding this line in my manifest solved my problem (the Service is well created). <service android:name=".TimersService" > Post I'm currently trying to implement alarms to notify the user that a countdown has finished. I have a method createAlarm() that adds a new Alarm through an AlarmManager . This method is currently called inside a Fragment. It looks like this: private final void createAlarm(String name, long milliInFuture) { Intent myIntent = new Intent(getActivity().getApplication(), TimersService.class); AlarmManager alarmManager = (AlarmManager) getActivity() .getSystemService

Service and IntentService, Which is better to run a service that poll database value from the server?

一笑奈何 提交于 2019-12-06 08:31:18
I had read quite a number of resources regarding the Service and IntentService . However when come to make a decision, I am not confident enough to choose which type to use in order to create a background service that will poll data from database in a time interval and stop it when I get the data I want since the data represent a status of a request, eg. ordering medicine confirmation status(pending, completed, in progress). I need to detect when a status is set to "completed" and send a notification to alert the user that the order is completed. After that the service will stop itself

Alarm Manager is not activating broadcast receiver?

社会主义新天地 提交于 2019-12-06 06:19:33
I am working on an application inwhich I am using AlarmManager for scheduling things. My Alarm is set. But this Alarm does not invoke BroadcastReceiver written to catch the event. I have searched a great deal but I have not found anything that solves the issue. I am posting my code, please have a look and see if I am missing something. AlarmManagerClass: public class ScheduleMessageManager { Context context; PendingIntent sender; AlarmManager am; public ScheduleMessageManager(Context context) { this.context = context; } public void addAlram(int scheduledMessageID, long scheduledTime) { //

Android Alarm not triggering at exact time

时光毁灭记忆、已成空白 提交于 2019-12-06 05:58:01
I have a problem using AlarmManager to run an IntentService at an exact interval. First i want to mention that i know about the changes to alarms since API level 19 and i have a proper way of handling things: public static void setServiceAlarm(Context con, long offset, boolean isOn, long lastHandledStamp){ Intent i = new Intent(con, StService.class); Bundle extra = new Bundle(); extra.putLong(EXTRA_TIMESTAMP, lastHandledStamp); i.putExtras(extra); PendingIntent pending = PendingIntent.getService(con, 0, i, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager manager = (AlarmManager) con

Alarm Manager won't work when the app is killed in the background and device is locked

China☆狼群 提交于 2019-12-06 05:42:24
问题 I have been stuck in this situation for a long time... I want to use the alarm manager to show notification at the specific time, and now it worked in the situation listed below: when the app runs in the background, notification will be shown at the correct time, and no matter the device is locked or not. after the app has been killed in the background, i will still get correct notification when device is not locked, but things turn wrong when the device is locked, i can't receive any

Alternatives for AlarmManager setRepeating in API 19 and above?

岁酱吖の 提交于 2019-12-06 05:36:14
My app requires very accurate timing of a repeating alarm. Since API 19 the AlarmManager setRepeating is now inexact to save battery ( Save the trees and all ). Is there any workaround to get API 19's setExact method to work on a loop? Note: as of API 19, all repeating alarms are inexact. If your application needs precise delivery times then it must use one-time exact alarms, rescheduling each time as described above. Legacy applications whose targetSdkVersion is earlier than API 19 will continue to have all of their alarms, including repeating alarms, treated as exact. Is there any workaround

Intent.putExtras not consistent

此生再无相见时 提交于 2019-12-06 04:33:38
I have a weird situation with AlarmManager. I am scheduling an event with AlarmManager and passing in a string using intent.putExtra. The string is either silent or vibrate and when the receiver fires the phone should either turn of the ringer or set the phone to vibrate. The log statement correctly outputs the expected value each time. Intent intent; if (eventType.equals("start")) { intent = new Intent(context, SReceiver.class); } else { intent = new Intent(context, EReceiver.class); } intent.setAction(eventType+Long.toString(newId)); Log.v("EditQT",ringerModeType.toUpperCase()); intent

Android: Is there a way to stop AlarmReceiver fired in BootReceiver

前提是你 提交于 2019-12-06 04:12:23
I am using a Boot receiver to fire AlarmManager,so that it repeats it's task every minute. I'd like the user to have in app option to enable/disable action that is done in every repeat of AlarmManager. So far I only used only a lame solution. I set user's preference in SharedPreferences and in every repeat of AlarmManager I check for user's preference in SharedPreferences and based on this preference the functionality is either executed or ignored. So far to my best knowledge, there is no way to completely destroy AlarmManager from within itself. but I might be wrong. Also, since boot receiver

Why is my AlarmManager firing off instantly?

流过昼夜 提交于 2019-12-06 03:48:38
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(), alarmIntent, 0); AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE); System.out