1. Site
Apache cordova - http://cordova.apache.org/
2. Download and istall...
It is recommended that the cordova CLI be installed from npm rather than downloading this .zip version. For more information on installing the npm version see the Command-Line Interface section of the documentation.
<< The Command-Line Infterface >>
http://cordova.apache.org/docs/en/3.6.0//guide_cli_index.md.html#The%20Command-Line%20Interface
To install the cordova command-line tool, follow these steps:
step 1>> Download and install Node.js. Following installation, you should be able to invoke node and npm on your command line. If desired, you may optionally use a tool such as nvm or nave to manage your Node.js installation.
Node.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
step 2 >> Download and install a git client, if you don't already have one. Following installation, you should be able to invoke giton your command line. Even though you won't be using git manually, the CLI does use it behind-the-scenes to download some assets when creating a new project.
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
step 3>> Install the cordova module using npm utility of Node.js. The cordova module will automatically be downloaded by the npm utility.
3. Install required packages
- Install android sdk.
Please see Android Platform Guide for android sdk. => http://cordova.apache.org/docs/en/3.2.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide_requirements_and_support
- Install Apache Ant.
http://ant.apache.org/index.html
- Update path
- android-sdks\platform-tools
- android-sdks\tools
- apache-ant\bin
4. Create Hello World application
Go to the directory where you maintain your source code, and run a command such as the following:
$ cordova create hello com.example.hello HelloWorld
5. Add Platforms
All subsequent commands need to be run within the project's directory, or any subdirectories within its scope:
$ cd hello
Before you can build the project, you need to specify a set of target platforms. Your ability to run these commands depends on whether your machine supports each SDK, and whether you have already installed each SDK. Run any of these from a Mac:
Please see Android Platform Guide for android sdk. => http://cordova.apache.org/docs/en/3.2.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide_requirements_and_support
You don't need to install all of these platforms.
For android, JAVA_HOME is specified as a system variables.
$ cordova platform add ios
$ cordova platform add amazon-fireos
$ cordova platform add android
$ cordova platform add blackberry10
$ cordova platform add firefoxos
Run any of these from a Windows machine, where wp refers to different versions of the Windows Phone operating system:
$ cordova platform add wp8
$ cordova platform add windows
$ cordova platform add amazon-fireos
$ cordova platform add android
$ cordova platform add blackberry10
$ cordova platform add firefoxos
Run this to check your current set of platforms:
$ cordova platforms ls
(Note the platform and platforms commands are synonymous.)
Run either of the following synonymous commands to remove a platform:
$ cordova platform remove blackberry10
$ cordova platform rm amazon-fireos
$ cordova platform rm android
6. Build the App
By default, the
cordova create script generates a skeletal web-based application whose home page is the project's
www/index.html file. Edit this application however you want, but any initialization should be specified as part of the
deviceready event handler, referenced by default from
www/js/index.js.
Run the following command to iteratively build the project:
$ cordova build
This generates platform-specific code within the project's platforms subdirectory. You can optionally limit the scope of each build to specific platforms:
$ cordova build ios
The cordova build command is a shorthand for the following, which in this example is also targeted to a single platform:
$ cordova prepare ios
$ cordova compile ios
SDKs for mobile platforms often come bundled with emulators that execute a device image, so that you can launch the app from the home screen and see how it interacts with many platform features. Run a command such as the following to rebuild the app and view it within a specific platform's emulator:
$ cordova emulate android
Alternately, you can plug the handset into your computer and test the app directly:
$ cordova run android