Also note we are getting increasingly hard-core on such services.  In Eclair
I think we tweaked things so that a long-running services' process will
eventually get moved from the "service" bucket to "background," to basically
guarantee it eventually gets killed (and the service restarted a little
while later).

Also since these services tend to be one of our more significant causes of
poorly behaving devices, we are iteratively working on making them visible
to the user so they can blame the correct apps, and I'd like to also have a
way for users to report them to developers through the feedback mechanism.
 I was also thinking of having a button the user could press to really
easily jump to market to rate the app. ;)

On Thu, Jun 10, 2010 at 1:46 PM, Mark Murphy <mmur...@commonsware.com>wrote:

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



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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