Android Binder Example

Midson picture Midson · Aug 26, 2010 · Viewed 23.1k times · Source

I am looking for simple binder IPC example in C/C++. Recently I started reading about the Android Binder basic (http://bharathi.posterous.com/android-binder) and gone thru the code in Android source also. Most of the binder usage part is in C++. Can some one explain why C++ is used instead of C?

Answer

Samuel Skånberg picture Samuel Skånberg · Oct 20, 2010

Check out http://github.com/mcr/Android-HelloWorldService (if you use later versions of android you may have to exchange some includes from #include <utils/something> to #include <binder/something>).

You can also download the android source code and look into frameworks/base/camera/tests/CameraServiceTest/CameraServiceTest.cpp

Cheers!