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

If it appears:



Indicates that the installation was successful

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 your own installation path)

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

3) Add the variable value in the path variable (existing without new):%java_home%\bin;%java_home%\jre\bin (Note the ";" between the variable values) Separated

4. "Start"-"Run"-enter "Javac" and "enter", if you can print the usage instructions correctly, the configuration is successful!

Analysis of supplemental environment variables:

java_home: Installation path for JDK

classpath: Java load classpath, only the class is recognized by Java commands in Classpath, and a "." is added before the path. Represents the current path.

path: The Java,javac command can be recognized by the system under any path.

5. Install Ant

Or the configuration of the environment variable

Operation as above

Adding Ant_home to System variables

The value is the path after your ant decompression

For example, my E:\phoneGap\apache-ant-1.9.4.

Add%ant_home%\bin\ant.bat in Path

Enter the Ant–version test at the command line and the following will be printed if OK:

Apacheant (TM) version 1.9.4 compiled on April 29 2014

6. And then we can create a project,

Enter a directory A at the command line, and then enter

Cordova Create Hello com . Example .  HelloWorld

This directory will be created under directory A.

At this point your a directory has a Hello folder.

7. Add 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 bundle Eclipse, about 500M, after decompression can directly use eclipse to develop the original eco-Android App, without configuration, Very convenient (adt-bundle-windows-x86-20140321)

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

9. Then go to configure his environment variables (haha, don't back down, as long as this configuration is successful, it is not far from success, do it! )

The purpose of configuring a system variable is to have the command line compile your program directly and then publish it to the emulator, which is convenient without eclipse.

or above, add in the system variable

Add the 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 (refer to 8,9)

11. Once the simulator is built, you can run your app on the emulator (the command line must switch to your A-directory Hello project)

Command line type:

Cordova Run Android

10, 112 steps please refer to

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

Eventually:

The last two steps are too lazy to write, please allow me to be lazy.

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.