Book Image

Cocos2d-x by Example: Beginner's Guide

By : Roger Engelbert
Book Image

Cocos2d-x by Example: Beginner's Guide

By: Roger Engelbert

Overview of this book

Table of Contents (19 chapters)
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – running the game in Android


Time to deploy the game to Android.

  1. Follow the instructions from the HelloWorld example to import the game into Eclipse.

  2. Navigate to the proj.android folder and open the AndroidManifest.xml file in a text editor. Then, go to the jni folder and open the Android.mk file in a text editor.

  3. In the AndroidManifest.xml file, edit the following line in the activity tag:

    android:screenOrientation="portrait"   
  4. And it's possible to target only tablets by adding these lines in the supports-screens tag:

    <supports-screens android:anyDensity="true"
              android:smallScreens="false"
              android:normalScreens="false"
              android:largeScreens="true"
              android:xlargeScreens="true"/>
  5. Although if you want to target only tablets, you might also wish to target the later versions of SDK, like this:

    <uses-sdk android:minSdkVersion="11"/>
  6. Next, let's edit the make file, so open the Android.mk file and edit the lines in LOCAL_SRC_FILES to read...