-
Notifications
You must be signed in to change notification settings - Fork 4
How to create a phonegap cocos html5 (Tutorial 2 Android)
VOZAX edited this page Aug 7, 2015
·
7 revisions
You need read Tutorial 1 at the first step
[How to create a phonegap cocos html5 (Tutorial 1 Google Chrom Browser)](https://github.com/yuye-liu/phonegap-cocos-html5/wiki/How-to-create-a-phonegap-cocos-html5-(Tutorial-1-Google-Chrom-Browser)
You shuould setup you android develop environment at first.
Tutorial for setting up android environment
You need Download "ANT" for android compiling and setup "ANT" as a system environmental variables
i.e MacOS
- open config file
cd && vim .bash_profile
- press "i" to insert code like below:
export ANT_ROOT="/Users/UserName/apache-ant-1.9.3/bin"
export PATH=$PATH:$ANT_ROOT
- press ":wq" to save your file
Here is a tutorial for windows
How to set the path and environment variables in Windows
Seting orientation
You can go to you open "AndroidManifest.xml" under this path(it depends on the position of your project)
cd /Users/UserName/phonegap-cocos-html5/platforms/android
Inserting code
android:screenOrientation="landscape"
in <activity like below code:
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="HelloWorld" android:screenOrientation="landscape" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Creating android project
$ cd ProjectName
$ phonegap run android