jni - How to call custom aosp service from android app -
i working on project runs on aosp. added system service aosp. run service using adb shell "service call" command successfully. while creating service, applied following ways.
- added aidl file
- added .java file derived aidl
- added jni file.
after creating service, wrote basic android app. want call service android app. how can call service android app.
i managed solve how system service calls android app. after compiling aosp, classes.jar in framework_intermediates file created out/target/common/obj/java_libraries. added classes.jar android app , used following codes.
ibinder binder = servicemanager.getservice("my_service"); imyservice myservice = imyservice.stub.asinterface(binder); int result = myservice.myfunction();
Comments
Post a Comment