Parent code as a separate process versus JNI

My current project is using an Android app with some native code. As far as I know, I can use the code as a separate binary to run in a separate process or via JNI, which makes communication easier.

Is it true that JNIs generally prefer the higher approach? Native code (which was written to compile into a UNIX file) really depends on continuous performance. It should not be affected by other code (like Android views, actions, processes, threads ...) at all, at least in theory. In practice, our goal is to simplify it as much as possible. Will JNI cause performance issues, especially regarding overhead messages and VM streaming?

A split binary will have the advantages - that it is easy to maintain - that the existing code base does not need to be modified (except for compatibility changes, of course) - that a process running a split binary may be less vulnerable to performance implications than a single-process JNI solution ...

+3


source to share





All Articles