PHONEGAP Development Environment Building (Android)

Source: Internet
Author: User

1. First install Nodejs (http://nodejs.org/)

2. Then enter NPM return at the command line

Suppose to appear:



Indicates a successful installation

3. Installation

NPM install-g Cordova

4. Installing the JDK

The most troublesome thing here is the configuration of the environment variables.

Configure environment variables: Right-click "My Computer"-"advanced"-"Environment variables"

1) Create a new java_home variable in the system variable, the value of the variable is: C:\Program files\java\jdk1.6.0_14 (fill in according to their own installation path)

2) New classpath variable, variable value is:.; %java_home%\lib;%java_home%\lib\tools.jar

3) in path variable (existing without new) join? Variable value:%java_home%\bin;%java_home%\jre\bin (note the value of the variable with ";" Separated

4, "Start" and "execute"-input "Javac"-"enter", assuming that the normal printing use method to explain the configuration success!

Analysis of supplemental environment variables:

java_home: Installation path for JDK

classpath: Java loaded classpath, only class in classpath Java command Talent recognition, in the path before the addition of a "." Represents the current path.

path: The system can identify the Java,javac command under no path.

5. Install Ant

Or the configuration of the environment variable

Operation as above

Add in System variables? Ant_home

The value is the path after your ant decompression

Like mine for E:\phoneGap\apache-ant-1.9.4.

Join in Path? %ant_home%\bin\ant.bat

At the command line, enter Ant–version test, OK will print such as the following words:

Apacheant (TM) version 1.9.4 compiled on April 29 2014

6. Then we'll be able to create a project,

Enter a folder A in the command line, and then enter

Cordova Create Hello com . Example .  HelloWorld

This folder will be created under folder A.

At this point your a folder has a Hello folder.

7. Join? Android Platform

At the command line, enter:

Cordova Platform Add Android

8. If you want to build Android projects, you need to download androidsdk, to download the SDK that bundle eclipse, about 500M, after decompression can be directly with eclipse to develop the original eco-Android App, without configuration, Very convenient (adt-bundle-windows-x86-20140321)

Open Eclipse, there are two such icons on the toolbar, click the second one to create an Android emulator

9. And then to configure his environment variables (haha, don't back down, just want this configuration success, is not far from success, do it! )

The purpose of configuring system variables is to be able to directly compile your program on the command line, and then publish it to the simulator without eclipse.

Or as above, add in the system variable?

Add the two paths of platform-tools and tools in the Android SDK to the path of the system variable

Give me a reference:

E:\phoneGap\adt-bundle-windows-x86-20140321\sdk\platform-tools

E:\phoneGap\adt-bundle-windows-x86-20140321\sdk\tools

10. Next you need to build an Android simulator (photo 8,9)

11. Once the simulator is built, you will be able to execute your app on the emulator (the command line must switch to your a folder in the Hello Project)

Command line type:

Cordova Run Android

10, 112 steps please take a photo

Http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide

Finally:

The last two steps bother to write, please agree with my laziness.

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.