2

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

2 Answers 2

3

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

The details of the various variants and how to call them are documented the JNI specification.

Sign up to request clarification or add additional context in comments.

Comments

0

If you want to integrate C++ and java with a lot less hassle, you should look into Jace http://sourceforge.net/projects/jace/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.