Satya Komatineni wrote:
> However if you want the widget to be a window to what a service does,
> can one of the buttons on a widget start the service, stop the
> service, and also collect some stats from the servcie.
> 
> In such a case can the widget provider and the service stay in the apk
> file and can the update messages rely on the static variables that the
> service keeps around.

Yes, that is technically possible.

However, you really do not want to have a service running all of the
time, either:

http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/

Starting service via a button in the widget does not need the service to
be running, by definition.

So, I would still recommend that the widget and the service be as
decoupled as much as possible, with the service running as little as
possible. You may have design constraints that make such decoupling
difficult; conversely, Android may have design constraints that make
what you want to do difficult.

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

_The Busy Coders' Guide to *Advanced* Android Development_ In Print!

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