Monday, February 7, 2011

Re: [android-developers] Re: Network I/O in background thread

07.02.2011 9:53, Amit пишет:
> As Kostya wrote: I should be considering that service may be killed in
> extreme condition if OS think.

And not only under extreme conditions. Recent versions of Android are
more proactive about removing unneeded background services, AFAIK that's
where you see "No longer want <service name>" in the log cat.

You can tell the framework that your service is doing something
important and should not be killed by calling startForeground (and
stopForeground when done). Those are Android 2.0 API methods.

This is exalained here:

http://android-developers.blogspot.com/2010/02/service-api-changes-starting-with.html

Another option is to make it so that your service can handle being
killed and resume what it was doing when restarted.

-- Kostya

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

No comments:

Post a Comment