This is an example of a Service using Messenger that allows multiple clients
to register for updates:

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerService.html

And the client code:

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerServiceActivities.html

On Wed, Jul 20, 2011 at 11:48 PM, winnie <vineet.0...@gmail.com> wrote:

> I have one application, to which many other services (from other
> applications say 3rd party apps) can be subscribed. And I need to get
> updated data into my application from the other applications, and so I
> require have bi-directional communication from my application to other
> services. The kind of data that I require from all the services is
> same.
>
> Right now using Messenger and Bound Services serves my purpose for bi-
> directional communication between my application and a service from
> ONE other application. But now I am stuck how can I extend it to
> support MULTIPLE services.
> I know I can get the "ComponentName" in the callback function
> "onServiceConnected(ComponentName, IBinder)" and so I can get the
> corresponding IBinder interface from the corresponding service (using
> just one ServiceConnection for all). But when  we unbind any service,
> then we unbind it with ServiceConnection as a parameter, so would it
> unbind all of my subscribed services which are attached via that
> ServiceConnection? Do I really need to have multiple
> ServiceConnections for every service? I am getting really confused
> with this. Could someone throw some light into possible solution?
>
> --
> 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
>



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