alarms

Scheduling alarm every 2 minutes android

断了今生、忘了曾经 提交于 2019-12-22 03:55:52
问题 In my activity class protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); AlarmManager alarmManager=(AlarmManager) getSystemService(ALARM_SERVICE); Intent intent = new Intent(MainActivity.this, AlarmReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0, intent, 0); alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,System.currentTimeMillis(),2000, pendingIntent); }

How can I setup multiple alarms in Android?

半腔热情 提交于 2019-12-17 08:48:08
问题 So far and thanks to this website, I've been able to set up an alarm that will be set up and active, even if I turn of my phone. Now, I set up a alarm to show a reminder for event A and I need the application to setup another alarm to show another reminder for event B. I must be doing something wrong, because it only fires the reminder for event A. It seems that once set up, any other alarm is understood as the same one. :-( Here is the detail of what I am doing in two steps: 1) From an

Android AlarmManager after reboot

▼魔方 西西 提交于 2019-12-17 04:21:52
问题 I have a set of alarms that I need to keep after reboot. I've tried using on an boot receiver but they won't start again. I'm not sure if I understand the boot receiver and how to then restart all the alarms. I already have one receiver for my notifications, but don't know whether I can use the same receiver or if I need a new one? Could anyone point me to any good tutorials or help me out? Cheers Code : DatabaseHandler db = new DatabaseHandler(this); List<UAlarm> alarms = db.getAllAlarms();

How does one launch android version dependent alarm clock? [duplicate]

一世执手 提交于 2019-12-11 17:36:03
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Intent to launch the clock application on android I have a widget that displays the time and if one taps on it, it launches the com.android.alarmclock/.AlarmClock activity with an PendingIntent . This works great before-Froyo, but with Froyo, I have to launch the com.android.deskclock/.AlarmClock. So I want to put in code that checks for the class existence and launch the appropriate activity/intent. Here is

why receive_boot_completed doesn't work on my device?

混江龙づ霸主 提交于 2019-12-09 20:05:43
问题 i am developing some app need to use receive_boot_completed on rebooting to reset some alarms it 's working properly on emulator and Samsung tab 2 10.1 .. but it isn't working on my galaxy mini device with android version 2.2.1 !!! this in my code : manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.engahmedphp.collector" android:installLocation="auto" android:versionCode="1" android:versionName="1.0" > <uses

Cancelling a single alarm when you have multiple alarms

荒凉一梦 提交于 2019-12-09 16:04:31
问题 I have used the same pendingIntent to set multiple alarms using different intentId for each. the alarm is working. Now i want to cancel a particular alarm. If i use the cancel() method i would end up cancelling all the alarms. I want only a specific one to be deleted. Also the user should be able to cancel this alarm even during a second or a third launch. As in when i launch it the second time, i won't be having the same pendingIntent object. Would i have to persist the pendingIntent object?

Scheduling alarm every 2 minutes android

末鹿安然 提交于 2019-12-05 02:24:56
In my activity class protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); AlarmManager alarmManager=(AlarmManager) getSystemService(ALARM_SERVICE); Intent intent = new Intent(MainActivity.this, AlarmReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0, intent, 0); alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,System.currentTimeMillis(),2000, pendingIntent); } And My onrecieve function in alarmreciever class @Override public void onReceive(Context context,

Get all alarms saved in the alarm application

白昼怎懂夜的黑 提交于 2019-11-28 19:53:27
Is it by any chance possible to get a list of alarms saved in the alarm application of android ? I am making an application which just needs to show the alarms set in the Alarm application. Thanx seanhodges There is a good explanation on this post regarding this. There are no guarantees that the AlarmClock app will be on every device your app is installed on. For example, many of the HTC phones replace it with HTC's own "World Clock" app. However, assuming the stock AlarmClock app is present, you should be able to get a cursor from its content provider. See this project as an example. Kaushal

Get all alarms saved in the alarm application

我是研究僧i 提交于 2019-11-27 12:32:33
问题 Is it by any chance possible to get a list of alarms saved in the alarm application of android ? I am making an application which just needs to show the alarms set in the Alarm application. Thanx 回答1: There is a good explanation on this post regarding this. There are no guarantees that the AlarmClock app will be on every device your app is installed on. For example, many of the HTC phones replace it with HTC's own "World Clock" app. However, assuming the stock AlarmClock app is present, you

How can I setup multiple alarms in Android?

不羁的心 提交于 2019-11-27 06:53:35
So far and thanks to this website, I've been able to set up an alarm that will be set up and active, even if I turn of my phone. Now, I set up a alarm to show a reminder for event A and I need the application to setup another alarm to show another reminder for event B. I must be doing something wrong, because it only fires the reminder for event A. It seems that once set up, any other alarm is understood as the same one. :-( Here is the detail of what I am doing in two steps: 1) From an activity I set an alarm that at certain time and date will call a receiver Intent intent = new Intent