Interesting Mark... is there no way to have something wake/start an app up
when a condition occurs? I was reading the blog on Screebl, it seemed like
with the Location support they can activate based on the location or other
conditions of the device. I wasn't under the impression that app was running
all the time.. or that it might be a service running in the background?

On a slightly different note, if you do run a service all the time, that
basically either waits for a timer, or waits for some condition, such as a
GPS location, does that drain battery much? I've not looked into the
Location api, but it sounded like Location would send out a message that a
service could listen for.. as if you could say "when the location of this
device is 'around' this location.. call me". Something like that?

Man, so much to learn!!

On Tue, Jan 19, 2010 at 7:41 AM, Mark Murphy <[email protected]>wrote:

> > I wanted to ask a question regarding the Alarm Manager. I have a
> > requirements of setting long running timers in my application. The
> minimum
> > duration for my timer is 1 hour...and the maximum may be for 4-5 days.
> > This
> > timer is supposed to run in the background, and when it fires/expires, i
> > have to show something on the GUI.
>
> Your "GUI" is probably not running when the alarm will go off.
>
> > What is the best approach for scheduling such long running timers ?
> >
> > Should i make use of the Alarm Manager ? Or will it be an overkill ?
>
> AlarmManager is the only viable choice for something of that duration.
>
> > I am thinking of using a simple Java TimerTask as an alternative to
> > setting
> > an alarm:
> > http://java.sun.com/j2se/1.5.0/docs/api/java/util/TimerTask.html.
>
> That will only work if the user is keeping your application running all of
> the time, and that is unlikely to be the case.
>
> > But i am not sure what will happen to the timer task if the device went
> to
> > sleep while the task was running.
>
> TimerTask does not wake up the device.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> Android App Developer Books: http://commonsware.com/books.html
>
>
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
-- 
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