Have u worked on AIDL?
Only if one is working on binder services, then only there is a fair chance of working on AIDL. IPC (Inter Process Communication) in android happens through kernel level Binder driver.
AIDL (Android Interface Definition Language) is a mechanism which internally uses Binders to access or to bind services of other applications.
Binder is an efficient way to do IPC when compared to serialization, thats why AIDL adopts Binder.
When a client application binds a remote service (which is in other application), that service will return an object using which client can call remote methods.
Since both client and service are in different applications, client would not know the type of object which is going to be returned. This is where AIDL
will be useful.
Steps to implement AIDL in service side (server side):
1. create aidl file, which contains function declarations which you want to expose to the client.
2. implement interface stub method in your service file.
3. create an object for stub and return it as binder object to client
steps to implement AIDL in client side:
1. implement ServiceConnection object, and get the binder object in
onServiceConnected() method, using aidl file interface name which was exposed by service.
2. Start calling remote methods by using that object.
Back To Top