The Binder (I)

High level view on the Android Binder

The Binder is one of the most interesting mechanisms in Android. Binder is an RPC/IPC mechanism. It might be surprising to many but the concept is not an Android innovation. It’s roots date back to BeOS before it was acquire by Palm. That Binder code was released as Open Source weeks before Palm’s death and named as OpenBinder. The project was started by George Hoffman and continued by Dianne Hackborn and the team at PalmSource. She was the one who actually opened it to The World before it disappeared. In any case, Android’s Binder is not a fork of OpenBinder but it is an implementation of that concept from the ground up. Yeap Dianne works at Android now 🙂

If you want to know more about the original OpenBinder, you should go and read the Documentation (, it remains a must-read. 

The Binder in Android is like the Rosette Stone. It allows Apps to talk to System Server and it enable Apps to talk to each other. Developers don’t need to know any of this. They just use different interfaces for the services but under the hood, those interfaces use the Binder under the hood. Developers just don’t see it.

Android Binder

Android Binder (from Embedded Android)

As you can see in the picture above, The Binder (/dev/binder), is placed in the middle of all the action and it is used in almost everything that happens across processes in the core platform.

For example, let say an application wants to instantiate the Window Service, the next line would be the necessary code:

WindowManager mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE)

The application now can use all WindowManager services like:

  • mWindowManager.addView(mDecor, l);
  • mWindowManager.removeView(mDecor);
  • mWindowManager.updateViewLayout(mDecor, params);
  • ...

When an application instantiates a Service, that process is going through the Binder to the Service Manager, look it up, and sends a reference to the App, then the App can go and requests remote calls from that object. like updateViewLaout(). If you need to know more about IPC/RPC I recommend you to read a developer’s introduction to RPC and XDR, from SGI IRIX documentation.

This is overall the first part of this Binder posts. The Binder is too complex to talk about it in just one post so lets keep them dropping step by step.

Tags: , ,

8 Responses to “The Binder (I)”

  1. I’m not sure exactly why but this site is loading
    extremely slow for me. Is anyone else having this issue or
    is it a problem on my end? I’ll check back later and see if the problem still exists.

  2. Great Articles and VERY Informative… I really appreciate your Efforts …

  3. Thank you so much.

  4. Thanks you for your comment!
    I know, I want to introduce first the different parts and its roles and then go more deep in them. I will edit “The Binder (I)” to add a link to “The Binder (II)” when it is ready. But I think that before going to deep in each of the components is good to meet the rest of the roles.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: