I've made a little JNI example. If you see the code, the only thing I do is to wrap C++ class methods inside a Java class, keeping a pointer inside it.
I have also included a little builder helper in the project (which compiles automatically the C++ source code), but it only works on GNU/Linux, inside a defined folder (in my case /home/jose/workspace/JNITest). If it causes problems to you, remove it following these steps:
Right-click on project->Properties->Builders, and then remove (or edit) the last one ("Native builder").
I hope this helps you!
- (96.41 KiB) Downloaded 413 times