How to call Java method from C ++

I am using JNI to call my C ++ function from Java. One of the arguments to the C ++ function is jobject thiz (as far as I know, all native JNI functions have this argument). This function takes a lot of time, and I want to report the progress back to the jobject thiz Java object so that I can show the progress to the user. How can I call jobject methods from C ++?

+2
java c ++ android-ndk jni
Apr 11 '10 at 14:18
source share
2 answers

You need to look at the JNI functions GetMethodID and Call<type>Method* .

Details of the various options and methods for calling them are documented by the JNI specification .

+3
Apr 11 '10 at 15:05
source share

If you want to integrate C ++ and java with much less problems, you should look at Jace http://sourceforge.net/projects/jace/

0
Apr 12 2018-10-12T00:
source share



All Articles