The Command-Line Interface
Install nodejs
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get install nodejs
$ sudo apt-get install build-essential
$ sudo npm install -g cordova
$ gedit ~/.bashrc
$ sudo apt-get install ant
$ sudo apt-get install nodejs
$ sudo apt-get install build-essential
$ sudo npm install -g cordova
$ gedit ~/.bashrc
$ sudo apt-get install ant
Create First App
$ cd /var/www/html/
$ ls
$ ls
$ phonegap create hello com.example.hello HelloWorld
or
$
cordova create hello com.example.hello HelloWorld
$ cd hello/
Add Platform
$
cordova platform add android
Run this to check your current set of platforms:
$ cordova platforms ls
Test Your App
Install phonegap app from google play store to your android device
and start server at PC by using following command
Build the App
Install phonegap app from google play store to your android device
and start server at PC by using following command
$ phonegap serve
[phonegap] starting app server...
[phonegap] listening on 192.168.1.11:3000
[phonegap]
[phonegap] ctrl-c to stop the server
[phonegap]
Enter the same address on you phone app and see the resultBuild the App
$ cordova build
Add Plugin Features
Camera, Media playback and Capture:
$ cordova plugin add org.apache.cordova.camera
$ cordova plugin add org.apache.cordova.media-capture
$ cordova plugin add org.apache.cordova.media