Creating your first Phonegap (Cordova) application
Before starting, it’s worth knowing the difference between Cordova and Phonegap:
Apache Cordova is mobile application development framework. In 2011 Cordova was purchase by Adobe and rebranded to PhoneGap. The open source version of PhoneGap continues to be released as Apache Cordova.
- Install Node.js
- Download and install the git client.
- Install cordova using the npm utility of Node.js (When using windows, the following commands will be inside the Node.js Command Prompt)
npm install –g cordova
- Create a cordova application by first CDing into the folder where you projects will exist, then:
cordova create hello com.example.hello HelloWorld
Cordova platform add ios
Cordova platform add android
- With the target platforms specified, the application can be built: Note: ensure that the Android
SDK is and the Apple Xcode SDK is installed.
The application will be automatically built for both Android and iOS.
Working applications for both Android and iOS will be generated in the /platform/ directory of the cordova application directory. The resulting APK (for android) can be loaded onto a phone or emulated through the virtual device emulator.