kittu
kittu

Reputation: 265

How to pass remote service name in bindService method using Messenger for Inter Process Communication

There are two apps. App1 and App2. App1 needs to call remote service declared in App2. As both apps are in different process,

How to pass RemoteService of app2 in bindservice method in app1. I m using Messenger framework for IPC communication.

Upvotes: 0

Views: 130

Answers (1)

Diego Torres Milano
Diego Torres Milano

Reputation: 69328

All that a client needs to do is create a Messenger based on the IBinder returned by the service and send a message using send().

To bind to the service use an Intent

    Intent intent = new Intent();
    intent.setClassName("com.sample.app2", "servicename");
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);

Upvotes: 2

Related Questions