I’m new to programming applications for the Android OS. As far as general architecture of the OS goes, I understand that processes are implemented as Linux processes and that each one is sandboxed.
However, I’m utterly confused on the IPCs and syscalls (if any) used. I know that the IBinder is a form of this; parcels are sent back and forth between processes and Bundles are array forms of parcels (?). But even that is still unfamiliar to me. Same with Intents. All in all, I don’t understand what kinds of IPCs are implemented and how.
Could someone briefly explain to me the specific methods used by user level applications in Android OS to communicate with each other and the OS? I’ve done kernel programming and played with various IPCs in Linux (Ubuntu and Debian) so it would help immensely if this was all explained in relation to what I’m familiar with…
Thanks in advance!
Android is a Service Oriented Architecture which means that all the applications on a device are made up of components that request work be performed by other components using a high level messages called Intents. While behind the scenes Intents that span applications are sent using Binder which relies on a special Android flavor of shared memory, the goal is for applications developers to be blissfully unaware of the implementation. The only requirement is, when a component wants to pass an object along with its “intention” to request work by another component that lives in different process, that object must be parcelable (think serializable). Additionally, in order for applications to use Intents of other applications, those Intents must be published in the manifest file using an Intent Filter.
An application that wanted to trigger the display of a webpage would have code that looks like this:
Another application that was capable of servicing that Intent by displaying the webpage would define the following intent-filters in its manifest so it would catch the Intent sent by the other application:
Beyond using Intents, you can create objects with proxy objects using AIDL that allow you to perform remote procedure calls across the process boundary.
You probably need not be concerned with how libc is performing syscalls since you are running inside a VM and are several levels removed from them. As far as “normal” IPC goes, you have sockets but you don’t have System V Shared Memory as it was deemed problematic and removed.