okay, that seems helpful, but it would be even better to be able to
ask the alarm manager if I have already registered for an alarm -- or
there is already an alarm registered at that looks like I did it.

I think the method you proposed would work for a clean install, but
things get messy when you start re-installing / installing over an
older version.  the older version may or may not have had the
BOOT_COMPLETED stuff in there.  now I gotta keep track of versions in
my code to know whether or not I need to register the alarm?

On Jan 11, 11:06 am, Mark Murphy <[email protected]> wrote:
> sdphil wrote:
> > I am trying to have some code execute every 24 hours.
>
> > I discovered this (great) thread --
> >http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > And looked at Mark Murphy's code --
> >http://groups.google.com/group/cw-android/web/Alarm.zip
>
> > But my question has to do with how to trigger the service even if the
> > phone has not been rebooted.  In other words, suppose someone installs
> > my application.  I would like to make it so that in 24 hours, it
> > executes some code, whether or not the phone has been rebooted.
>
> Register your alarm when they first run the app. Set a flag (file,
> shared preference, database) to let you know it was the first time you
> were run.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android 2.0 Programming Books:http://commonsware.com/books
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to