How to Create a android native service and use binder to communicate with it?

前端 未结 3 1906
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 15:50

My basic task is to create a native service in android and then write a simple native program to test it. lets say I want to write a simple service which return me sum of tw

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 16:39

    After studying and coding @ Android NDK, I found The binder API is NOT available in Android NDK. And even if you use android open source for invoking the binder api, maybe you will get permission denied because of the binder security checking.

    Here if I want to add a service to System service, I need a system level user group. The detail codes you can find https://github.com/qianjigui/android_system_service_example. It contains C and Java level's client and service, but you need the system permission.

提交回复
热议问题