Cocos2d-x learning journey (3): 1.3 cocos2d-x Windows 7 Android Development Environment Construction

Source: Internet
Author: User
Tags android sdk manager

Preparations:

1. Download JDK 7, corresponding to 32-bit or 64-bit.

Http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Download Eclipse: http://www.eclipse.org/downloads/

3. Download Android JDK: http://developer.android.com/sdk/index.html

4. Download Android ndk (R8): http://developer.android.com/tools/sdk/ndk/index.html

5. Download cygwin: http://www.cygwin.com/

 

Step 1: Install JDK, which is the basic condition for running eclipse.

 

After the installation is complete, configure the environment variables:

Right-click "Computer properties" and click "Advanced System settings"

 

New Environment Variable: java_home value: C: \ Program Files \ Java \ jdk1.6.0 _ 33

New Environment Variable: classpath value: .. % java_home % \ Lib;

Add % java_home % \ bin after the PATH value of the system variable ;.

After the configuration, verify whether the installation is successful. Win + R, the CMD command is displayed, and enter Java-version.

If the following interface is displayed, the JDK environment is configured successfully.

 

Step 2: Install eclipse, decompress the downloaded eclipse to your computer, and click eclipse to run.

 

Step 3: Install the android SDK, click the installer_r20.0.3-windows to run.

I putProgramInstalled under D: \ android.

After the configuration, you can configure the environment variables for future convenience.

New Environment Variable: android_sdk value: D: \ Android \ platform-tools; D: \ Android \ tools

Add % android_sdk % to the System Path Environment Variable type

Verify whether the operation is successful. Enter ADB-H in cmd. The following page is displayed after the operation is successful:

 

 

After the android SDK is installed, the android SDK manager is displayed. You need to select an API to download the SDK quickly.

I will select android2.3.3 and android4.0.3.

 

 

Step 4: Install eclipse ndk

Start eclipse, "help"-> "install new software"-> "available software"-> "add repository"-> "Location:" Input

Http://dl-ssl.google.com/android/eclipse

 

 

After loading, select the following options and click Next to complete the installation.

 

 

 

After the installation is complete, restart eclipse

Decompress android-ndk-r8b-windows.zip to D: \ android-ndk-r8b

Open eclipse, find window-> preferences in the menu, and set the ndk directory to the unzipped directory.

 

 

Step 5: Install cygwin

 

Run the just-downloaded setup.exe and select install from Internet.

Select the Save path as c: \ cygwin.

Wait for the installation item to load and select the installation item

 

 

Compile the ndk. Under the default settings, you only need to select devel (Click devel in the list and change default to install, as shown by the arrow in the figure)

Others are in the default status.

(In fact, ndk need not much, mainly autoconf2.1, automake1.10, binutils, GCC-core, GCC-, G ++, gcc4-core,

Gcc4-g ++, GDB, PCRE, PCRE-devel, gawk, make)

The download completion time depends on the number of installation packages you select and the network connection speed.

 

Configure cygwin

Enter the cygwin directory in the command line and execute cygwin. bat. If you are not using the Administrator account to log on to the system, cygwin \ home \

Folder to generate a new folder named after your login name.

Modify the file ". bash_profile" in the new folder and open it in a text editor such as UE or editplus,

Add at last: (D/android-ndk-r8 is the path to install ndk)

Ndk_root =/cygdrive/D/android-ndk-r8

Export ndk_root

Save and close.

So far we have basically built the cocos2d-x Windows 7 Android environment.

First look at the cocos2d-x running under the real machine effect, is not very Hyun, want to try it yourself.

The next section describes how to compile Android C ++ in eclipse.CodeAnd compile the android sample code for the cocos2d-x,

And how to create a cocos2d-x for Android projects.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.