android-alarms

Alarm everyday at 5AM morning

杀马特。学长 韩版系。学妹 提交于 2019-12-04 22:05:42
I am working on an android application where I need to trigger an alarm every morning at 5 am. I have already used the concept of Intent (below is the code) and putting AlarmManager in the Service . But I didnt get the problem solution from both implementations. I am just looking for a perfect solution for this. If I add a reminder to the calendar for 1 month once the application is opened for the first time I guess that might work. But if there is any better solution for this, then please provide. It should trigger an alarm at 5 AM every day no matter what. How can I achieve this?

setAlarmClock not exact in android marshmallow

前提是你 提交于 2019-12-04 19:10:47
I use setAlarmClock method of Alarmmanager for do alarm clock application. When I set alarm clock from 6.00 AM and alarm in 6.01 AM . It delay and not exact. Code when setAlarmClock . Intent intent = new Intent(getBaseContext(), AlarmReceiver.class); intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); intent.putExtra(AppConstant.REMINDER, note.convertToString()); PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), note.getId(), intent, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); if (Build

Android: Pending intent not calledon snooze with multiple alarm

ぐ巨炮叔叔 提交于 2019-12-04 18:33:31
I am working on adding multiple alarm functionality in my existing app. Earlier, the alarm was single only and every thing worked fine. I have been able to set multiple alarms, it is working fine too, but problem is with snooze feature. Earlier, snooze was working perfect. But, after multiple alarm implementation it is not working. I never get dialog for snoozing alarm, once I press snooze button. Here is my code: Set alarm method public void setAlarm(boolean AlarmEnabled, int AlarmHour, int AlarmMin) { //Build Intent/Pending Intent for setting the alarm Intent AlarmIntent = new Intent

Android: why did the Alarm notification stop after system reboot

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 12:54:42
问题 I am developing an android application that should fire an alarm five times a day: - the times in each day is not constant - after the alarm is fired I will schedule the next alarm. My problem is : the alarm notification works for 1 day then it stops and also when the device is rebooted twice the notification doesn't work , I don't now if there is another way to do that , any help will be very appreciated! Code: I have this function to call the broadcast reciever public static void Start

How to update an app widget on midnight?

混江龙づ霸主 提交于 2019-12-04 05:38:54
My app has a widget that shows today's date and need to be updated on midnight. The widget is defined in the manifest as <manifest> ... <application> ... <receiver android:name=".MyWidgetProviderClass" android:label="MyLabel" > <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_icon_info" /> </receiver> </application> </manifest> And the widget info file is <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialLayout="

Overwrite existing alarm

夙愿已清 提交于 2019-12-04 03:48:01
问题 I create an alaram in my app which is calling a BroadcastReceiver to setup notifications ever day with this code: Intent intent = new Intent(Benachrichtigung.CUSTOM_INTENT); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 8); calendar.set(Calendar.MINUTE, 00); calendar.set(Calendar.SECOND, 00); alram = (AlarmManager) getSystemService(Context.ALARM

Bind Service to BroadcastReceiver

Deadly 提交于 2019-12-04 03:06:39
问题 I have some Service class, which registers multiple alarms. In my BroadcastReceiver class, I want the onReceive () method to call some method of the Service class. However, I don't see how I can bind them together. I tried to make the BroadcastReceiver an inner class, but then I got more errors and couldn't fire the alarm at all. Thanks 回答1: Look at http://developer.android.com/reference/android/content/BroadcastReceiver.html life cycle. BroadcastReceiver is created only for handling a

Android background services and alarms

折月煮酒 提交于 2019-12-04 02:07:50
问题 Recently encountered with a problem when Android 4.4 killed my app's Service and AlarmManager when device going into a sleep mode ( START_STICKY param doesn't helps). I tried a lot of things, but nothing works as I need. In my task manager app I always see a lot of processes of non-default apps such as Google+, Skype, Google Drive end some else that working in real time and never were killed by the system. I want to ask more experienced developers how to create Service or Alarm that will not

Service run on specific Time Android

送分小仙女□ 提交于 2019-12-04 01:59:55
问题 I am trying to run service on every day only on Specific time, lets say every day 8 :00 am and here I found two methods as public static void setScheduleMessage(Context context, int hours, int minuts, int seconds) { Calendar calendar = Calendar.getInstance(); // 8 AM calendar.set(Calendar.HOUR_OF_DAY, hours); calendar.set(Calendar.MINUTE, minuts); calendar.set(Calendar.SECOND, seconds); PendingIntent pendingIntent = PendingIntent.getService(context, 0, new Intent(context,

Error in building Alarm app from android source

不问归期 提交于 2019-12-04 01:54:47
问题 I want to build an app which extends basic alarm clock functionality. Since I am not inventing any wheel in the alarm functionality, I would like to use the android default alarm which is available openly. However I have tried to build it many times but there are just too many errors (mentioned here also): I tried this approach also but I am still not able to build it. Can anyone please guide on how to build the android application provided in git android tree. Links I referred to: Alarm