On Mon, Oct 4, 2010 at 4:35 AM, Zsolt Vasvari <[email protected]> wrote:
> This is a somewhat private question, but maybe of some interest to
> others.

BTW, there's the [cw-android] Google Group for CommonsWare-specific
questions like this:

http://groups.google.com/group/cw-android

> I am looking at the SystemServices example.  It's pretty clear to me
> what's going on, other than using WakefulIntentService.  What is the
> significance of keeping the device awake in your example while you are
> executing the service?

In that specific example? Not much. However, creating something where
it *would* be important would add a lot of bulk to the example for
little benefit.

In general, you keep the device awake when you need to (e.g., to
complete a download).

> Is there a danger of the OS killing the
> service while it's executing?

In theory, yes, but the typical uses of an IntentService like this
(alarms, app widget updates, etc.) mean that the service is very
short-lived, so it is rather unlikely that Android will destroy it to
free up RAM.

> The reason I am asking is that I don't have a problem with obtaining
> the WakeLock, other than it requiring another permission, which I
> don't want to ask for unless there is a real good reason.

If you don't mind the device falling asleep while you're doing your
alarm-scheduled work, then don't use WakefulIntentService. But, if
falling asleep could screw things up (e.g., middle of a database
transaction, middle of a Web service operation), you'll want to keep
the device awake.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 3.0.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 [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