Book Image

Building Android Games with Cocos2d-x

By : Raydelto Hernandez
Book Image

Building Android Games with Cocos2d-x

By: Raydelto Hernandez

Overview of this book

Table of Contents (16 chapters)
Building Android Games with Cocos2d-x
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Understanding the Cocos2d-x structure for the Android platform


In Chapter 1, Setting Up Your Development Environment, when we were installing all the required components for building the Cocos2d-x framework, we told you to download and install Android Native Development Kit (NDK), which allows us to build the Android applications by using the C++ language instead of using the mainstream Java technology core for which the Android API has been written.

When an Android application is launched, it looks in its AndroidManisfest.xml file for an activity definition that has the intent filter android.intent.action.MAIN, and then it will run the Java class. The following listing shows the segment of the AndroidManifest.xml file generated by the Cocos new script, where the activity to be launched when the Android application starts is specified:

<activity
   android:name="org.cocos2dx.cpp.AppActivity"
   android:configChanges="orientation"
   android:label="@string/app_name"
   android:screenOrientation...