I have been working with Android JNI + NDK for the last month, and I am creating two ways to return data from C ++ to java. The problem is that I'm not sure about the performance.
-) The first general way and the most difficult is to call the constructor of the java object from the JNI and return the job.
-) The second way to add the toJson () function to a C ++ class and return the string representation of the class in java. a java class that catches data, parses it for an object using Gson.
This operation will call 200 times per second.
The question goes to developers who have already tried it and can share their knowledge with me. (for those who mark this with -1, remember that stack overflow is here for knowledge sharing). TY.
source
share