Using AIDL for C++ Android Native Service in AOSP

  aidl, android, android-source, c++

I would like to create a native Android service (C++) that talks to an Android application. I am using Android 11 (AOSP). I will be integrating said native Android service to AOSP code, and will install the application in order to test.

In order to get the idea first, I am searching for basic examples. I have checked out this code https://github.com/YancyGitHub/native-service/tree/master/android_L, however it is done in Android Oreo and it gives build errors. Android 11 suggests that I will have to create .aidl files for interfaces.

There are many resources online for talking between Java server and client such as this one: https://www.protechtraining.com/blog/post/implementing-remote-interface-using-aidl-66. However I have yet to find an example, or even instruction on how to use AIDL with C++ on Android 11 for native services.

I am looking for any pointers how to proceed with such task. Any guidance is greatly appreciated. In case of any missing information that I forgot to provide, please do ask. Thanks in advance.

Source: Windows Questions C++

LEAVE A COMMENT