What is the best way to save JNIEnv*

Caching a JNIEnv* is not a particularly good idea, since you can’t use the same JNIEnv* across multiple threads, and might not even be able to use it for multiple native calls on the same thread (see http://android-developers.blogspot.se/2011/11/jni-local-reference-changes-in-ics.html) Writing a function that gets the JNIEnv* and attaches the current thread to the VM if necessary … Read more