What are the IPC mechanisms available on Android?

Someone please tell me what are all the IPC mechanisms that are present in Android.

As far as I know, this is:

  1. Intents
  2. Binders
+54
android android-intent ipc android-bundle android-binder
Apr 21 '11 at 6:22
source share
5 answers

There are three types of IPC mechanism in Android:

  • Intentions (together with connections)
  • Binding
  • ASHMEM (anonymous shared memory). The main difference between Linux shared memory and this shared memory is that on Linux other processes cannot free shared memory, but here, if other processes require memory, this memory can be freed by Android OS.
+33
May 09 '11 at 9:40 am
source share

IPC is interprocess communication. It describes the mechanisms used by various types of Android components to communicate with each other.

1) Intents are messages that components can send and receive. This is a universal mechanism for transferring data between processes. With intent, you can start services or actions, call broadcast receivers, and so on.

2) Bundles are data objects that are passed through. This is similar to serializing an object, but much faster on Android. The package can be read from intent using getExtras() .

3) Binders are entities that allow actions and services to receive a link to another service. This allows you to not only send messages to services, but also directly call methods for them.

+84
Apr 21 2018-11-11T00:
source share

As written on the Android Developers page, IPC mechanisms in Android include:

  • Intent (with packages included)
  • Binders or messengers with the service
  • BroadcastReceivers
+22
Feb 07 '14 at 2:18
source share

All answers are nice and concise in this post. But I would like to highlight on which IPC mechanism I should use . First of all, IPC means Inter Process communication , where two applications or processes will communicate with each other, transferring some data between them. Since android is designed for embedded and small devices, we should not use serialization for IPC , instead we can use BINDERs , which uses parcels internally. Parcel is a kind of lightweight serialization using the concept of shared memory.

There are many differences between Binder IPC and Serialization IPC:

1. Serialization is very difficult to use in embedded devices; communication will be very slow. 2 .. Binding uses packets to make IPC really fast. 3 .. Binders internally use the concept of shared memory, which uses less memory when sharing data between two processes.

Bottom Line: BINDERs uses less memory and is pretty fast since it uses parquet. serialization very difficult, it takes time to send and receive data, and also requires more memory than attachments.

Note. To transfer data between actions, services, and recipients, use only Bundles . Do not use serialization or binding. Linking devices are specifically used only for linking services in which 2 processes will interact.

Hope this helps :)

+15
Feb 17 '16 at 7:57
source share

There are three types of IPC mechanisms:

  • handler
  • binder implementation
  • Aidl
+5
Sep 17 '12 at 11:50
source share



All Articles