keyeslabs wrote:
> If you have a very good reason for doing so (one that you're willing
> to defend to users and the likes of Mark) then you can force the
> service to have the same priority as an activity use setForeground.
> The caveat is that you must keep a notification visible for your
> service.

Note that it is startForeground() as of Android 2.0.

You wouldn't typically use that for a boot-time, try-to-be-everlasting
service, though.

Having an activity starting and stopping a service, using
startForeground() and a Notification, is a truly delightful pattern.

I just cringe when developers try making services last forever,
particularly starting at boot. It is development anti-patterns like
everlasting services that cause all those industry pundits to say you
need to use task killers to have your Android devices run well.

As with many anti-patterns, there are spots for which everlasting
services are valid (e.g., VOIP client waiting on a socket for an
incoming call). But those are the exception, not the rule.

That's why I boo.

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

Android Consulting: http://commonsware.com/consulting

-- 
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