JNI is a knowledge anyone developing games with cocos2d-x must have. As I don’t known it enough to feel comfortable with the theme so I started studying it myself.
During my learning process I like to take notes and share what I’m discovering. This post aims to be an introductory text on JNI. I will try to teach you the basics so you can understand how it works and how to integrate your own Java / native code (C/C++).
It is essential when developing games for Android using cocos2d-x.
There are 2 scenarios when it comes to JNI:
- Java code calling native code (C/C++)
- Native code (C/C++) calling Java code.