In the previous chapter, we have discovered how to get a Java class descriptor with JNI method
. But we can get much more! Actually, if you are a regular Java developer, this should remind you of something: the Java reflection API. Similarly, JNI can modify Java object fields, run Java methods, access static members... but from native code. This is often referred to as a Java callback, because Java code is run from native code which descends itself from Java. But this is the simple case. Since JNI is tightly coupled with threads, calling Java code from native threads is slightly more difficult. Attaching a thread to a VM is only part of the solution.
For this last part with the Store project, let's ...