This is an example of how to use Android IPC binders from native C++ code. It is modified with reference to Gabriel Burca's article and source code. The links are as follows.
- Understanding and implementing native Binders in android using C++
- The Android IPC system
- Using Android IPC binders from native code
git clone https://github.com/jcdkuo/binder_example.git
to android/externel folder
Go to your android root folder, then run
source build/envsetup.sh
lunch ${PRODUCT_NAME}
Go to binder example folder (binder_demo_server/binder_demo_client), and run
make clean
make
push exec file to rootfs system/bin
folder, then you can exec it.
use logcat | grep "binder"
to see the log