Thanks Mark. Why can't timers or handlers be used ?. There is nothing in 
the documentation  of why  timers or handlers cant be used to run tasks 
after 24 hours.
AlarmManager  is more heavy weight on the OS. The documentation says that 
you must acquire a WAKE lock when processing the alarm, since the device 
can go to sleep as soon as the Intent is processed.  This behavior is also 
not what we really want for the application. The application has a simple 
requirement to run a task every 24 hours. 

- Tarak

On Sunday, March 18, 2012 3:27:16 PM UTC-7, Mark Murphy (a Commons Guy) 
wrote:
>
> On Sun, Mar 18, 2012 at 3:07 PM, Tarak <tsri...@ipass.com> wrote:
> > I have a requirement to run a task periodically after 24 hours and made 
> use
> > of postDelayed (Runnable r, long delayMillis) .
>
> Do not do that. Use AlarmManager for periodic tasks like this.
>
> -- 
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 4.1 Available!
>
>
On Sunday, March 18, 2012 3:27:16 PM UTC-7, Mark Murphy (a Commons Guy) 
wrote:
>
> On Sun, Mar 18, 2012 at 3:07 PM, Tarak <tsri...@ipass.com> wrote:
> > I have a requirement to run a task periodically after 24 hours and made 
> use
> > of postDelayed (Runnable r, long delayMillis) .
>
> Do not do that. Use AlarmManager for periodic tasks like this.
>
> -- 
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 4.1 Available!
>
>
On Sunday, March 18, 2012 3:27:16 PM UTC-7, Mark Murphy (a Commons Guy) 
wrote:
>
> On Sun, Mar 18, 2012 at 3:07 PM, Tarak <tsri...@ipass.com> wrote:
> > I have a requirement to run a task periodically after 24 hours and made 
> use
> > of postDelayed (Runnable r, long delayMillis) .
>
> Do not do that. Use AlarmManager for periodic tasks like this.
>
> -- 
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 4.1 Available!
>
>
On Sunday, March 18, 2012 3:27:16 PM UTC-7, Mark Murphy (a Commons Guy) 
wrote:
>
> On Sun, Mar 18, 2012 at 3:07 PM, Tarak <tsri...@ipass.com> wrote:
> > I have a requirement to run a task periodically after 24 hours and made 
> use
> > of postDelayed (Runnable r, long delayMillis) .
>
> Do not do that. Use AlarmManager for periodic tasks like this.
>
> -- 
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 4.1 Available!
>
>

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to