android-alarms

AlarmManager wont fire pending intent

谁都会走 提交于 2019-12-24 07:35:20
问题 I try to use AlarmManager with BroadcastReceiver. My problem is that I dont get the intent fire from the AlarmManager. Im not getting any call from Log.i("test", "test") Here is my code: public void activityCheck() { Intent intent = new Intent(this.getApplicationContext(), com.example.workoutlog.UsageCheckService.class); intent.putExtra("nofitication", "nofitication"); PendingIntent service = PendingIntent.getService(this, 0, intent, 0); AlarmManager m = (AlarmManager) this.getSystemService

Android : Set reminder functionality

爱⌒轻易说出口 提交于 2019-12-24 04:19:52
问题 I am developing an application with reminder functionality. The code i used is as follows to set the reminder and event: private void addReminder(int statrYear, int startMonth, int startDay, int startHour, int startMinut, String title){ // Convert start of begin time of reminder in milliseconds. Calendar beginTime = Calendar.getInstance(); beginTime.set(statrYear, startMonth, startDay, startHour, startMinut); long startMillis = beginTime.getTimeInMillis(); // String to access default google

Show Notification at particular time with AlarmManager

折月煮酒 提交于 2019-12-24 02:09:54
问题 I need to display a notification daily at particular time (for example: 4.25PM). I am using AlarmManager and Notification . I set the alarm on landing page of the application. I also have implemented the BroadcastReceiver for it. Code to set the alarm: Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 16); calendar.set(Calendar.MINUTE, 25); calendar.set(Calendar.SECOND, 0); Intent notificationmassage = new Intent(getApplicationContext(),Notificationmassage.class);

How to wake up my App Periodically

泄露秘密 提交于 2019-12-23 19:27:28
问题 I want to make an functionality, like reminder, in Android. I want to start-up my app/activity, when it is not running, or its UI is invisible. It is some-thing like same as reminder, that wakes ups the app at desired time. I have not worked with any type of background task or service, so I haven't any idea that what to do, or what type of classes or demos should be studied by me? Can any one give me some suggestions with demos or tutorials links. Thanks, in advance. 回答1: Hi use the following

Alarm is not working in android when the device is off and on again

只愿长相守 提交于 2019-12-23 12:06:16
问题 I have set the alarm to remind me in android it is working when the device is on. But when i switch off the device and again on that reminder alarm is not working. Can you guys please suggest me how can solve this problem? My code looks like this, Intent myIntent = new Intent(getApplicationContext(), serviceclass.class); PendingIntent pendingIntent = PendingIntent.getService(getApplicationContext(), CONST+id, myIntent, PendingIntent.FLAG_UPDATE_CURRENT); Calendar calender = Calendar

How to poll a webservice at finite interval from android?

坚强是说给别人听的谎言 提交于 2019-12-23 07:57:57
问题 i am developing an android app to show notifications.How can i poll a webservice at finite interval (say 10 min interval) to check for any update and show as notification in android notification panel. 回答1: You do not need a service. I feel like a broken record. In this use case a service will sit there for 95% of the time doing nothing but still using system resources and more importantly drain the battery. Please see my answer on a similar question that uses an Alarm from the AlarmManager:

Android Alarm Manager not working with specific date and time

本小妞迷上赌 提交于 2019-12-23 06:14:46
问题 So I have been working on medication intake app, where I need to remind the user locally ( no internet/push notification needed) about taking their medication. I am using Android Alarm manager for this. Below is the code Note I am trying to schedule the alarm for a specific date: "13 July 2018 at 3h30 PM" . I schedule and wait but the reminder didn't fire (so not broadcast) however if I used AlarmManager.ELAPSED_REALTIME_WAKEUP with a defined amount of millisecond it does fire ( but

Why is my alarm being set recursively?

若如初见. 提交于 2019-12-23 04:36:48
问题 I have two values in my Database: Hour = 10 Minute = 20 EDIT: By Recursive I dont mean that the alarm is being set for tomorrow and hence forth, the onReceive of my Alarm class is getting called recursively. I have the following function to set and Alarm using the above values from Database. public void SetAlarm(Context context){ retrieve(context); // returns the hour, minute and day value. Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis());

Android repeat alarm manager in not triggering immediately

会有一股神秘感。 提交于 2019-12-23 03:45:22
问题 My code: Calendar calSet = Calendar.getInstance(); calSet.set(Calendar.HOUR_OF_DAY, 11); calSet.set(Calendar.MINUTE, 20); calSet.set(Calendar.SECOND, 0); calSet.set(Calendar.MILLISECOND, 0); PendingIntent pi=PendingIntent.getBroadcast(context,0,myIntent,PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP,calSet.getTimeInMillis(),pi); and say, I'm executing at 11:30. Alarm

Alarm manager for background services

可紊 提交于 2019-12-23 03:35:28
问题 I have implemented the alarm manager to wake up the background services every 15 mins periodically. It is working fine, but since the inclusion of DOZE mode Android 6.0, the seems like behaving strange and not waking up in every 15 mins. Although, I am using the method alarm.setExactAndAllowWhileIdle(), but still not working in Idle state here is my method for implementing Alarm Manager private void serviceRunningBackground() { final Intent restartIntent = new Intent(this, service.class);