Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the IPC mechanisms available in the Android OS?

Will any one please tell me what are all the IPC mechanisms that are present in Android.

To my knowledge are:

  1. Intents
  2. Binders
like image 998
Suman Avatar asked Apr 21 '11 06:04

Suman


People also ask

What are IPC mechanisms in OS?

Inter Process Communication (IPC) refers to a mechanism, where the operating systems allow various processes to communicate with each other. This involves synchronizing their actions and managing shared data.

What are the two types of IPC techniques?

Synchronization in Interprocess Communication The two types of semaphores are binary semaphores and counting semaphores. Mutual exclusion requires that only one process thread can enter the critical section at a time.

Which is the best IPC mechanism?

Shared memory is the fastest form of interprocess communication. The main advantage of shared memory is that the copying of message data is eliminated. The usual mechanism for synchronizing shared memory access is semaphores.


2 Answers

IPC is inter-process communication. It describes the mechanisms used by different types of android components to communicate with one another.

1) Intents are messages which components can send and receive. It is a universal mechanism of passing data between processes. With help of the intents one can start services or activities, invoke broadcast receivers and so on.

2) Bundles are entities of data that is passed through. It is similar to the serialization of an object, but much faster on android. Bundle can be read from intent via the getExtras() method.

3) Binders are the entities which allow activities and services to obtain a reference to another service. It allows not simply sending messages to services but directly invoking methods on them.

like image 51
Vladimir Ivanov Avatar answered Sep 22 '22 04:09

Vladimir Ivanov


There are three types of IPC mechanism in Android:

  1. Intents (along with Bundles)
  2. Binders
  3. ASHMEM (Anonymous Shared Memory) - The main difference between Linux shared memory and this shared memory is, in Linux other processes can't free the shared memory but here if other processes require memory this memory can be freed by Android OS.
like image 24
Suman Avatar answered Sep 24 '22 04:09

Suman