Original address: http://blog.csdn.net/xingboss3/article/details/8267512/
Combined with the following three articles
Http://www.cnblogs.com/lhming/archive/2012/06/27/2566460.html
Http://www.cnblogs.com/lhming/archive/2012/06/27/2566467.html
Http://www.douban.com/note/229610750/
1. Installing the Java JDK
http://www.oracle.com/technetwork/java/javase/downloads/index.html Download the JDK for your system
Android development without JRE,JRE is a Java virtual machine, Android has its own standalone virtual machine
New environment variable: The Java_home value is: D:\Program files\java\jdk1.7.0 value is the JDK installation directory, according to their own situation changes (the best directory of the path name is in English)
Click Environment variables
Select New for System variable
New environment variable: CLASSPATH value is:.; %java_home%\lib; (Note: The dot indicates the current directory and cannot be omitted)
Add the following in front of the value of the system variable path:%java_home%\bin; (note: The semicolon here cannot be omitted) here, the JDK is installed. The back of Android is what I set to add after Android, ignoring.
Click Start, Run, enter: cmd command, enter in cmd window: java-version
The following interface appears, indicating that the installation was successful:
2. Installing the Androi SDK
Http://developer.android.com/sdk/index.html
The installation will check for JDK installation and will fail if not installed successfully.
Then run SDK Manager.exe to update the SDK (it is recommended to download the corresponding version of the SDK if necessary) (if no http://blog.sina.com.cn/s/blog_6e1ad0cf01013v9u.html appears)
Click Install Packages. (Click to accept All, the corresponding version of the API is all installed), in order to facilitate, also configure the environment variables
If there is an error warning http://blog.sina.com.cn/s/blog_4a94a0db0100y4h7.html
New environment variable: ANDROID_SDK value: G:\Android sdk\platforms; G:\Android Sdk\platform-tools (This is the two subdirectories in the location where the SDK is stored)
In the System PATH environment variable type join:%android_sdk%
Click Start, Run, enter: cmd command, enter in cmd window: adb-h
3. Download the Android NDK
Http://developer.android.com/tools/sdk/ndk/index.html
Download unzip, then useful
4.Cygwin Installation
Since most of the NDK development involves compiling and running in the GCC environment, the Linux simulated compilation environment needs to be simulated in the Windows environment:
http://www.cygwin.com/
After the download is a Setup.exe file, the use of the following procedures:
The first step: Run the Setup program, the first step of the diagram, click Next directly to enter the next step.
The second step: Choose the installation method, the first time can be used direct connection online download installation, if there is an off-the-shelf offline package, you can choose to install offline (install from Local Directory).
The third step: Select the installation directory, such as C:\Cygwin, note that this directory refers to the Cygwin final installation directory, not the download file staging directory.
Fourth step: Set the local package staging path
The staging directory is placed in the Setup.exe sibling directory by default, and the downloaded name is similar to the ftp%3a%2f%2fcygwin.mirrors.pair.com%2f format.
Fifth step: Set up network connection mode
Sixth step: Select Download Site Address
At first try a few to see which speed to use which address (if you feel uncomfortable, click Cancel, again).
Seventh step: Wait for the loading of the installation item to load, select the installation item
We compile the NDK, in the default settings, just select Devel (click on devel in the list, change the following default to install, the arrow in the figure), and the others are the defaults. (In fact, the NDK does not need much, mainly autoconf2.1, automake1.10, Binutils, Gcc-core, gcc-, g++, Gcc4-core, gcc4-g++, GDB, Pcre, Pcre-devel, Gawk, Make)
Eighth step: Wait for the download to complete
There may be an error during the download and a different address to download. Download completion time depends on the number of packages you choose and the network connection speed, for example, according to the default selection method of this article, it may take 2-3 hours (depending on the speed), download the package about 1.2G, after the download is completed automatically installed to the installation directory set above.
Reminder: After the first download is completed, it is best to make a backup of the downloaded package directory, the next time you install the same environment can directly use the offline installation method (in the second step, select Local installation).
Run Cygwin, in the popup command line window input: Cygcheck-c Cygwin command, will print out the current Cygwin version and running state, if the status is OK, then Cygwin run normally.
Then enter gcc–v,g++--version,make–version,gdb–version to test, (note the space and-) if you print out the version information and some descriptive information, this indicates that the Cygwin installation was successful.
5. Installing ADT
1 Installing the Android development plugin
(1) Open Eclipse and select Help->install New software on the menu bar to see the following interface:
Click the Add button and the following screen appears
Input URL: https://dl-ssl.google.com/android/eclipse/(If an error occurs, change HTTPS to HTTP)
Name: Android (can be customized here)
Click OK and the following screen will appear
All selected.
Click the Next button and the following screen appears:
Click the Next button and the following screen appears:
Select I Accept the terms of the license agreements click Next and go to the Install plugin interface
After the installation is complete, the following interface appears
Click the Yes button to restart Eclipse.
Click on the menu window->preferences to enter the following screen:
Select your Android SDK to unzip the directory (ADT 18 will scan your PC by default, locate and configure the SDK location).
Open the AVD Manager from the Windows Start menu, create a new virtual machine, and complete
Enter the Cygwin directory on the command line and execute Cygwin.bat, and if you are not logged in with the Administrator account, a new folder will be generated in the Cygwin\home\ folder named after your login name.
Modify the ". Bash_profile" file in the new build folder, open with a text editor such as UE or EditPlus, and add at the end:
NDK_ROOT=/CYGDRIVE/E/ANDROID-NDK-R8-WINDOWS/ANDROID-NDK-R8 (E/android-ndk-r8-windows/android-ndk-r8 is the path to install the NDK)
Export Ndk_root
Then save the shutdown.
Android Project creation and compilation reference my top second article
Into the Cygwin terminal generally so to be
If you want to go to the appropriate directory, the CD instruction is to change the current path
In my installation process encountered a problem is that the steps are correct, the program is not installed in the virtual machine The second 19 has that problem, 22 floor has the answer
(from cocos2d-2.0-rc0a-x-2.0, support the Open GL es2.0, the default project creation is required to run on the Open GL es2.0, that is, the simulator is not yet supported, so must be used to debug the real machine)
1. Turn on the phone set-up-app-dev-->usb debug tick
2. Connect the computer with the data cable (connection type can not be selected)
3. Install the driver for the phone, cannot find the driver to install with Driver wizard
4. Check whether the device is detected sh17dtj00468 is the serial number of the phone
Select Project, right-click, run As-->run configurations--> left column to select the corresponding project
Select target on the right-hand column, select Launch on all compatible DEVICES/AVD ' s, then select active devices and AVD ' s, and you can run on the real machine.