My installation and testing of the phonegap.

Source: Internet
Author: User
Tags install node

I. Introduction of PHONEGAP

PhoneGap is a fast-developing platform for creating mobile cross-platform mobile applications using HTML,CSS and JavaScript. It enables developers to take advantage of the core features of Iphone,android,palm,symbian,wp7,bada and BlackBerry smartphones-including geolocation, accelerators, contacts, sounds and vibrations, and PhoneGap has a rich plug-in, can be called.

Second, PHONEGAP installation

First declare the landlord's computer is Win8 64 system.

1, the first to match their own Java environment JDK. The officer network download corresponds to its own version of the JDK, installation I will not say more, any search engine can search. Once installed, open the console.

  

The following output shows that the environment is set up.

2, install Node.js,node.js official website,

3, installation Cordova

Because now PhoneGap's code has been contributed to the Apache Software Foundation (ASF), and renamed Apache Cordova. The name comes from Vancouver's Córdoba Street (Cordova Street), which is the location of Nitobi company when PhoneGap was created. So we have to install the Cordova, the previous installation method is no longer applicable.

Open Console Input:

NPM install-g Cordova

Then if there is no problem, you can proceed to the 4th step, if not installed and then look at the front of the no steps have errors, or on the Internet to find other people's blog, here recommend a blog, I mostly follow the above: JiangYang Trail

4, create the app, into the folder you want to create the app, or the console enter the following code skills to create your own app folder:

$ Cordova Create Hello Com.example.hello HelloWorld

Add the platform you want (platform) in addition

$ cd hello$ Cordova platform add ios$ Cordova Platform add Amazon-fireos$ Cordova Platform Add android$ Cordo VA platform Add blackberry10$ Cordova Platform add firefoxos$ Cordova Platform add wp8$ Cordova Platform add windows8$ Cor Dova platform Add Amazon-fireos$ Cordova Platform Add android$ Cordova Platform add blackberry10$ Cordova platfor M Add Firefoxos

5, a more critical step, here is the Android development platform, for example, download and install the latest JDK, Android SDK, Apache Ant.

The following are:

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Http://developer.android.com/sdk/index.html

http://ant.apache.org/bindownload.cgi

After the installation is complete, remember to configure the environment variables.

To add a new environment variable, adjust the following path according to the installation path:

Android_home Value:c:\program FILES\ADT-BUNDLE-WINDOWS-X86_64-20140321\SDK

Ant_home Value:c:\program Files\apacheant

Java_home Value:c:\program files\java\jdk1.8.0_05

Add to Path

%java_home%\bin;%ant_home%\bin;%android_home%\platform-tools;%android_home%\tools;

After completing the above and then in the Android SDK installation directory, there is the SDK Manager.exe program, start the program on the command line. In Tools->manage Avds, create a new Android emulator.

  Note: Here is a place where the egg hurts, the landlord with others cuff Sdk-manager the highest only api-19 version so spent a few hours to download the api-21 version (speed is really you understand).

Create a simulator based on your computer's configuration, and then start it, and wait until the long boot process is complete to the final step.

6. Compile and run

Console into your Hello folder, enter the following code:

$ Cordova Emulate Android

If your virtual machine runs the following results:

To this end, there is also a detail part of the environment variable path is set to relative sometimes will be problematic, such as ant installation, before it must be changed to the absolute address to use, well the introduction to this first.

My installation and testing of the phonegap.

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.