Monday, February 7, 2011

Re: [android-developers] Re: Scheduling ideas

Neil,

A background service may be stopped by Android at its discretion.

The beauty of AlarmManager is that it doesn't matter - when an alarm
fires, the component that the pending intent is intended for will be
started as necessary.

The alarms are not kept in the application's process, they are kept
inside an Android component. You can verify your alarms by running
"dumpsys alarm" (singular) in the adb shell.

Having said that, there may be a bug in your code. Since your code,
AFAIK, schedules one alarm at a time, there may be a situation where the
old alarm already fired (and forgotten), and the new one isn't
scheduled. You should schedule the new alarm as soon as you receive the
old one. Ideally, right inside onReceive for the old alarm's broadcast
action, because onReceive is guaranteed to not be interrupted.

-- Kostya

07.02.2011 12:21, Neilz пишет:
> More issues with this.
>
> I'm testing on a Nexus and Hero. It all runs fine on the Nexus, but on
> the Hero after I schedule the alarm, sometimes the process seems to
> die:
>
> 02-07 09:00:36.664: INFO/ActivityManager(98): Process
> com.my.app.activity:remote (pid 1813) has died.
>
> And that's it, no other log messages. So my alarm fails, and I never
> know about it until I find it didn't run the next morning.
>
> Any ideas why this would happen, or ways to stop this?
>


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment