I need get JNIEnv* from extension cpp code. How i can do this? Please help!
You can access JNIEnv*
from Haxe by using lime.system.JNI.getEnv ()
You can pass this from Haxe to C++, then use it there, with a little bit of CFFI:
import lime.system.CFFI;
import lime.system.JNI;
...
testextension_init (JNI.getEnv ());
...
private static var testextension_init = CFFI.load ("testextension", "testextension_init", 1);
value testextension_init (value env) {
JNIEnv* jni = (JNIEnv*)(uintptr_t)val_data (env);
// do something with jni variable
}
DEFINE_CFFI (testextension_init, 1);
1 Like