thinking more about this, would this work?  suppose someone installs
the app, but doesn't run it.  then reboots the phone.  now I've got
the alarm broadcast receiver registered.

then the user launches my app, my app checks the flag and decides that
this is the first time it has ever run, so decides to register an
alarm.

now, I've got two alarms running that will go off at approximately the
same time.

i guess a solution would be to ignore second alarm when it gets
triggered??

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