Closed houzhj58 closed 3 months ago
@houzhj58, Sorry for the long delay in replying.
In IMyService.aidl
there is String complexType(in ComplexType aComplexObject);
interface method, where ComplexType
is an Object type.
If you want to see an example of passing an Java Object from a Java client to a C++ binder service, please take a look at following places in the code.
JavaBinderClient/src/main/java/.../MainActivity.java
(line 85)NdkBinderService/src/main/cpp/MyService.cpp
(line 15)Does this help?
I add function in IMyService.aidl
void send (Bundle aBundle);
andimport android.os.Bundle
but when I exec
gradlew build
, it shows:ERROR: android.os.Bundle: couldn't find import for class android.os.Bundle
I guess beceuse there is no cpp files for java Bundle class.In google website, there is a funciton AParcel_fromJavaParcel, but no function AParcle_toJavaParcel.
So if anyone knows how to send java object by using binder_ndk.