alarmmanager

Unable to schedule notification with AlarmManager on Android (using Qt)

一曲冷凌霜 提交于 2019-12-12 12:20:11
问题 I am doing the following from a qt 5.5. project. I am trying to schedule a local notification using the alarm manger in android. This is the code to schedule the notification: class ScheduledNotifications { static public int notification_id = 0; static int scheduleNotification(String title, String content, int futureInMilliseconds) { ++notification_id; Intent notificationIntent = new Intent(QtNative.activity(), NotificationPublisher.class); notificationIntent.putExtra(NotificationPublisher

why app service restarting, and not able to restart?

泪湿孤枕 提交于 2019-12-12 10:56:32
问题 it is a tracking app of 24*7. Whenever it stops i use START_REDELIVER_INTENT to restart it, but it is not start every time. It shows below type response in Application manager. Please suggest. 回答1: I just discovered that if the service is killed on on 4.1.1, START_REDELIVER_INTENT can take even 20 minutes to restart the service. The restart always coincides with the next dalvikvm garbage collection. Until then the service is stuck on "Restarting" as shown in the question. However START_STICKY

Pending intent with different intent but same ID

孤人 提交于 2019-12-12 10:45:59
问题 I have two pending Intent to use with Alarm Manager one is: Intent i = new Intent(context, TriggerAlarm.class); PendingIntent pi =PendingIntent.getBroadcast(context,0,i,PendingIntent.FLAG_CANCEL_CURRENT); and the other is: Intent i = new Intent(context, TriggerNotification.class); PendingIntent pi = PendingIntent.getBroadcast(context,0, i,PendingIntent.FLAG_CANCEL_CURRENT); I use these two in different methods in my application my question is: Are these pendingIntents differnt from each other

About the difference between the alarms of type of AlarmManager.RTC_WAKEUP and AlarmManager.RTC

為{幸葍}努か 提交于 2019-12-12 09:55:12
问题 What is the difference between the alarms of type of RTC_WAKEUP and RTC ? From the documenatation of the AlarmManager , it seems that alarms of RTC will not wake up the device if the device current is asleep, and will not delivered until the next time the device wakes up. But I found that the alarm of type of RTC will still wake up the device, so what's going on? What I did is to change the type of RTC_WAKEUP to RTC in the AlamrManagerService.java , function setRepeating() , and then set an

how to repeat alarm after 1 day in android

女生的网名这么多〃 提交于 2019-12-12 09:02:06
问题 I m using the alarm manager in my app and i want to repeat alarm after one day. the alarm should be invoked after one day when invoked once by time.Please help. Thanks in advance. if(str_freqSchedule.equals(checkForDaily)){ Calendar calendar = Calendar.getInstance(); //calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR)); calendar.set(Calendar.HOUR_OF_DAY, hr); calendar.set(Calendar.MINUTE, min); calendar.set(Calendar.SECOND,0); Intent intent = new Intent(this,

Notifications not received on Android

耗尽温柔 提交于 2019-12-12 07:59:12
问题 I am developing an android-application which main usage is displaying notifications at a set time (some specific calendar app). One of the main complaints is that users do not (always) receive notifications , and I am at wits end. We have internally tested the code below against Android 4.4, 6, 7.0, 7.1, 8.0, 8.1 on emulators and used about 10 real devices (6 to 8.1), and all devices received their notifications on time. Even across reboots, the notifications were all received on time. One of

DP5 7.0 - Does adding extras to a pending intent fail?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 07:54:26
问题 Adding the linked issue on tracker: https://code.google.com/p/android/issues/detail?id=216581&thanks=216581&ts=1468962325 So I installed the DP5 Android 7.0 release onto my Nexus 5X today. I've been working on an app that schedules local notifications at specific times using Android's AlarmManager class. Up until this release, the code has been working great on devices running KitKat, Lollipop, and Marshmallow. Below is how I'm scheduling the alarms: Intent intent = new Intent(context,

Clarification of AlarmManager behavior in Android

房东的猫 提交于 2019-12-12 07:14:04
问题 I see all the examples of AlarmManager being set by an Activity. My question is this: If my application sets a recurring AlarmManager, does that persist even after the application that started is is closed and removed from memory? If not, how do I start an AlarmManager at a lower level that is started by Android at boot up and if it ever fails or dies or throws an exception is restarted without the user having to do anything? Lastly, if the action I wish for the BroadcastReceiver to undertake

Alarm Manager isn't repeating after reboot

白昼怎懂夜的黑 提交于 2019-12-12 05:34:24
问题 I have problem with Alarm Manager. I create alarm manager which repeat displaying toast every 15 seconds. After rebooting my device, toast is visible, but only once. I want to repeat it again every 15 seconds even after reboot. What can I add to solve this? Is this possible? Here is my code (class AlarmReceiver extends BroadcastReceiver): @Override public void onReceive(Context context, Intent intent) { PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);

Android Set multiple repeat alarms

跟風遠走 提交于 2019-12-12 04:51:12
问题 I want to set 3 different alarms repeat everyday.(like 9:00am,1:00pm,6:00pm) And I have created buttons for them. I can set the alarm's time when I click the button. The problem is how can I change my code to achieve above mentioned. private void setNotification() { Intent myIntent = new Intent(getActivity(), MyReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(getActivity(), 0, myIntent, 0); AlarmManager alarmManager = (AlarmManager)getActivity().getSystemService