android-alarms

android - Alarm stops firing after some time

非 Y 不嫁゛ 提交于 2021-02-11 14:24:35
问题 I have an alarm that fires every hour and executes code in specific conditions It works smoothly, but when I leave my app unopened (the alarm initialization is on app startup) it stops after some time, these are the logs: 8/2/2020 6:27 AM Initializing Alarm, next alarm will fire at 8/2/2020 3:27 AM 8/2/2020 6:27 AM Application starting. 8/2/2020 6:28 AM Application stopped. 8/2/2020 6:28 AM Reports alarm received. 8/2/2020 7:28 AM Reports alarm received. 8/2/2020 8:28 AM Reports alarm

Android: Read Gmail Message Body From a Service with Gmail api

蹲街弑〆低调 提交于 2021-02-05 12:17:29
问题 What I want that, from a service, I want to read the gmail message body when a gmail notification has arrived. When The Gmail Notification has arrived an alarm will occure and I get the full body text in alarmReceiver. I got the android quick start here gsuits api : https://developers.google.com/gsuite/guides/android . But there only describes about Android Sdk And Dependencies. I did not find the whole procedure for capturing gmail body. dependencies { compile fileTree(dir: 'libs', include:

Android: Read Gmail Message Body From a Service with Gmail api

蹲街弑〆低调 提交于 2021-02-05 12:16:35
问题 What I want that, from a service, I want to read the gmail message body when a gmail notification has arrived. When The Gmail Notification has arrived an alarm will occure and I get the full body text in alarmReceiver. I got the android quick start here gsuits api : https://developers.google.com/gsuite/guides/android . But there only describes about Android Sdk And Dependencies. I did not find the whole procedure for capturing gmail body. dependencies { compile fileTree(dir: 'libs', include:

How to start a activity from a broadcast receiver when the screen is locked in Android Q

淺唱寂寞╮ 提交于 2021-01-28 02:20:42
问题 I am trying to implement an alarm based application in Android Q using a broadcast receiver. I am running a foreground service using notification for triggering the alarm broadcast receiver. The service is working fine and it is also triggering the broadcast receiver. If we close the application or lock the screen after setting an alarm, the service will be running in the foreground with a notification. When the alarm broadcast is called I am trying to open a new activity when the screen is

How to show a notification everyday at a certain time even when the app is closed?

*爱你&永不变心* 提交于 2020-11-30 06:45:51
问题 Although this question might have been asked before on Stack Overflow, I still haven't found a clear answer. I want to show a notification everyday at 12pm for example even when the app is closed. I have referenced from those links: Notifications in specific time every day android, Android daily repeating notification at specific time of a day using AlarmManager, Android BroadcastReceiver on startup - keep running when Activity is in Background and much more... I'm confused on the difference

How to cancel alarm programmatically in android? [duplicate]

此生再无相见时 提交于 2020-08-20 07:17:08
问题 This question already has answers here : Android Alarm Clock - Remove alarms programmatically (2 answers) Closed 6 years ago . I used this code to create an alarm and it works. Please suggest how to cancel that alarm. Intent alarmIntent = new Intent(AlarmClock.ACTION_SET_ALARM); alarmIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); alarmIntent.putExtra(AlarmClock.EXTRA_MESSAGE, mEdtTitle.getText() .toString()); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR, mTimePicker

How much delay is there when setting an inexact alarm via AlarmManager? [duplicate]

房东的猫 提交于 2020-01-11 10:22:10
问题 This question already has an answer here : How inexact is setInexactRepeating() for AlarmManager? (1 answer) Closed 3 years ago . When using AlarmManager to set an alarm, there could be a delay in which the alarm is triggered some time after the specified time unless you set an exact alarm. Is there any guarantee on what the range of this delay could be? I want to be a responsible developer and not use exact times if the delay is not more than, say, one minute. But I can't find any