Search code examples
androidandroid-binder

How to bind java service in native code?


Is it possible to bind java services in pure native code? Essentially, calling this part of code in under native C code

Intent i = new Intent(); 
i.setClassName("com.example.fooservice", 
    "com.example.fooservice.service"); 
bindService(i, clientConnection, Context.BIND_AUTO_CREATE);

Solution

  • No, not directly. However, you could accomplish it calling up to your NativeActivity via JNI.