Chapter 8. Adding Native Java Code
Until now, we have been creating our game by using only the programming language in which the Cocos2d-x game framework has been written (C++); nevertheless, the Android API written by Google is only available in the Java layer of the application. In this chapter, you will learn how to communicate our native C++ code with the higher end Java core by using the Java Native Interface (JNI) capabilities.
The following topics will be covered in this chapter:
Understanding the Cocos2d-x structure for the Android platform
Understanding the JNI capabilities
Adding the Java code to the Cocos2d-x game
Adding ads to the game by inserting the Java code