Tuesday, 9 February 2016

PhoneGap : The Linux Guide

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
Create First App
$  cd /var/www/html/
$  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

 
$ 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 result




Build 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 

 

 

 



 

 

 

 

 

 

 

Source

No comments:

Post a Comment