3

I read about bound service and AIDL based service on Android developer guide

Both seem to allow other components to bind to and perform Interprocess communication

Bound service allows components (such as activities) to bind to the service, send requests, receive responses, and even perform interprocess communication (IPC).

AIDL (Android Interface Definition Language) is similar to other IDLs you might have worked with. It allows you to define the programming interface that both the client and service agree upon in order to communicate with each other using interprocess communication (IPC).

So what is the difference ?

onmyway133
  • 45,645
  • 31
  • 257
  • 263

2 Answers2

2

AIDL is just one way to communicate with a bound service. There is no such thing as a 'AIDL based service', it's just a bound service that returns a Binder generated based on an AIDL interface.

Vukašin Manojlović
  • 3,717
  • 3
  • 19
  • 31
Nikolay Elenkov
  • 52,576
  • 10
  • 84
  • 84
  • In the ADIL guide on Android developer says **"Note: Using AIDL is necessary only if you allow clients from different applications to access your service for IPC and want to handle multithreading in your service. If you do not need to perform concurrent IPC across different applications, you should create your interface by implementing a Binder"** so what does this mean ? – onmyway133 Oct 04 '12 at 04:17
  • It means what is says: if you use AIDL you allow multiple clients to connect concurrently and you should be able to handle this. If you use a messenger, it will serialize requests for you. If you use the service in the same process, you can access it directly (no IPC) via your own class that extends Binder. – Nikolay Elenkov Oct 04 '12 at 04:22
0

AIDL is a contract, if the client talks to the service AIDL is the format used so both know what it means. Alternativly you could put this, that and theOther into a bundle and say here. Oh lookie that,this and theOther or you could send messages.

Bound service implies the parties to the contract should know each other like a phone number, binder, name or something. Service should know client and perhaps client should know service.

Pomagranite
  • 696
  • 5
  • 11