How do I implement my own Android service?

I need to implement a service entirely from C / C ++ using the NDK, but there seems to be no NativeService equivalent for the supported NativeActivity. It is my understanding due to the fact that the Binder class is not exposed through the NDK, and would appreciate if someone can explain why this is preventing the Native Service from working on Android and if there are any workarounds other than unacceptable use of the unsupported class / library.

One of the schemas that comes up for me is to just write a NativeActivity and access it essentially by writing only service parts in Java for the standard Android SDK. Can anyone see something wrong with this approach? This has the advantage of avoiding using JNI at least ...

Thank,

+3


source to share





All Articles