[android-developers] Setting a wait/sleep on a Service

2011-03-02 Thread Chris Stewart
I'm looking at building a service into my app, and here's what I'm currently
reading:
http://developer.android.com/guide/topics/fundamentals/services.html#ExtendingIntentService.
 It seems to suggest that the way you set a wait, or sleep, is to add it in
the onHandleIntent method.  Is that correct or is that simply for the
purpose of being a sample?

Effectively, I want to go and download a file every 15 minutes, see if it
has changed, and send a status bar notification if it has.  Would the above
be the way to go about implementing that?

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

Re: [android-developers] Setting a wait/sleep on a Service

2011-03-02 Thread Kostya Vasilyev
I'd use AlarmManager, possibly with IntentService or Mark Murphy's 
WakefulntentService.


That wait() in the sample is just to illustrate that the service might 
be doing something that takes a certain length of time.


-- Kostya

01.03.2011 22:09, Chris Stewart пишет:
I'm looking at building a service into my app, and here's what I'm 
currently reading: 
http://developer.android.com/guide/topics/fundamentals/services.html#ExtendingIntentService. 
It seems to suggest that the way you set a wait, or sleep, is to add 
it in the onHandleIntent method. Is that correct or is that simply for 
the purpose of being a sample?


Effectively, I want to go and download a file every 15 minutes, see if 
it has changed, and send a status bar notification if it has. Would 
the above be the way to go about implementing that?


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



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