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.

  1. added aidl file
  2. added .java file derived aidl
  3. 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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -