http://www.math.uni-hamburg.de/doc/java/tutorial/native1.1/implementing/index.html
Call Java class methods
jmethodID mid = (env)->GetMethodID(cls, “callback”, “()V”);
if (mid == 0) {
return (env)->NewStringUTF(buff);
}
(env)->CallVoidMethod(thiz, mid);
Make a Jclass global reference, lifetime == app life
cls = (*env)->NewGlobalRef(env, cls1);
if (cls == 0) {
... /* error */
}
Remember to free the reference when finish DeleteGlobalRef