alarmmanager

Confusion regarding number of alarms needed to be set

前提是你 提交于 2019-12-10 23:45:15
问题 I have the following data in SqlLite as well as Postgresql database and am successfully showing it in a tablularlayout on my android widget.It's basically a timetable for college students. a http://www.4shared.com/download/1w7Tyicfce/random3.png I did set OnClickListener for all the textviews individually,which means each and every subject name which you're seeing is clickable in my app. Upon clicking on a subject name i.e a textview ,a page shows up as following. a http://www.4shared.com

Difficulties with Android Alarm Manager, Boot Complete

余生颓废 提交于 2019-12-10 23:34:53
问题 I encountered an issue where my scheduled tasks stopped working once a device was rebooted. I was informed this was normal behavior for Alarm Manager, and that I should use the BOOT_COMPLETED action. Unfortunately, it is still not working. Here is what I have The main/launcher activity public class launch_activity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_launch_activity);

How to reset alarm after reboot Android Studio

自古美人都是妖i 提交于 2019-12-10 22:19:24
问题 I'm making an Alarm app which opens an activity based on time picked by User. Everything's working perfectly fine but alarm gets reset by reboot. I made an ON BOOT RECEIVER which works but I want to restart the Alarm only if the user wants it to go. I tried to use .putExtra to send data to ON BOOT broadcast but that data gets reset after reboot. I tried to set conditions using SharedPreference in broadcast but I'm stuck on how to use it. MainActivity public class MainActivity extends

What is the difference between scheduling same task using alarm manager vs ScheduledExecutorService

拟墨画扇 提交于 2019-12-10 18:39:43
问题 Hi I was reading on internet that we can schedule any thing which we want to run at a gap of certain interval using alarm manager and ScheduledExecutorService . I want to know what is the difference between them and what to use when Thanks in advance. 回答1: ScheduledExecutorService is something inside your process. If your process is already around for other reasons, such as it is supplying the foreground UI, and you want to use ScheduledExecutorService for periodic work, that's fine. However,

Best Practices for developing an Activity with a background Service

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 18:27:04
问题 My Application has an Activity for the UI and a Service for background polling fun. Seems like standard fare. Can AlarmManager trigger the Service Intent without Activity OnCreate being called? Is there any benefit to putting the Activity & Service into different Applications? Would this create 2 apk's and make it impossible to put into Market as one app? Can you put 2 applications into one manifest somehow? Regarding communication between the two: -If Activity & Service are part of the same

Setting alarm on monthly basis android

谁都会走 提交于 2019-12-10 18:13:06
问题 I am developing an android app for setting alarm on daily, weekly, monthly basis. The first two are working fine by converting the give date and time into milliseonds. But when I am trying to do the same for monthly it doesn't work. There is totally different date format. I am setting it as below, Alarmtimefor30 has the given date in milliseconds. am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTimefor30, 30*1440*60000 , pi); I am giving intervalMillis as 30*1440*60000 which results to

Alarm in Android stops when some hours has passed

♀尐吖头ヾ 提交于 2019-12-10 17:57:00
问题 I'm making an app that needs to do some tasks repeteadly, usually between 1 and 5 minutes. I have tried .setRepeating , setInexactRepeating and .set (the last one re-setting the alarm when the task is done) When the alarm fires a service is started. Usually it works well, but sometimes the alarm suddenly stops firing, no matter what method I use. I have tested in Android 5.1 and 4.4.2. Why is this happening? Is this a known bug or something? Here is the method I use to set the alarm, the

Using an AlarmManager to check periodically that my permanent service is running

╄→尐↘猪︶ㄣ 提交于 2019-12-10 17:52:57
问题 I have a Service which should keep a permanent connection to a server in order to receive notifications. It's critical for my app to get the messages from the server on time. I cannot use GCM Push because the connection will be in the local network and the phone may not have any internet connection. I also know about the battery issues of keeping a permanent connection within a service, but I will let the user choose this option and inform him/her about the potential battery drain (Actually

static AlarmManager in Android

拥有回忆 提交于 2019-12-10 15:12:48
问题 I'm developing a simple tasks app in Android and I need to create notifications via an AlarmManager. My problem is that I have certain alarms that should be deleted -and thus their notifications- but they aren't, so I decided -following posts such as Delete alarm from AlarmManager using cancel() - Android to make the AlarmManager a static variable so the same instance can be reached from the whole app. The way I'm doing this is having the following method in my main class: public static

What happens to undelivered AlarmManager repeating alarms when phone wakes up?

﹥>﹥吖頭↗ 提交于 2019-12-10 14:49:09
问题 If we schedule an inexact repeating alarm with AlarmManager.setInexactRepeating to be fired every hour, for example, what happens if the phone is in standby for 4 hours and then it is woken up? Does the system deliver 4 alarms in a row for the same PendingIntent or does it deliver only a single alarm? EDIT: reading the documentation with more attention, the set(int, long, android.app.PendingIntent) method documentation says: Alarm intents are delivered with a data extra of type int called