On Wed, Dec 8, 2010 at 3:55 PM, Moto <[email protected]> wrote:
> 1. What if the service is controlled only by intents and the service
> dies... The activity using this service would have no clue that it
> died unless I'm bound to it...

Services should not spontaneously "die".

If Android has to get rid of a service to free up memory, not only
will your activity probably be long gone, but you can tell Android
what to do when memory is in better shape via your onStartCommand()
response.

That, plus a top-level exception handler
(Thread.setDefaultUncaughtExceptionHandler()) should mean you do not
have to worry about this problem.

> 2. I would have to provide a service intent to burst service status
> broadcast so that the activity can be updated with the latest
> information of the running service.  This would work, but is this
> method recommended?

For frequent in-process service->activity messaging, I'd use a Messenger.

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