Working with PhoneGap – Installation and Startup
- Apr 23, 2015
Hello everyone!!! Its feeling like it has been over a decade since I have written last article here. But, being here always inspires me, challenges me and completes me.
Check out the following video to get an idea of what PhoneGap can do.
Okay, I guess you would have got basic idea of PhoneGap, so lets use it now.
- PhoneGap Desktop App
- Node.js (Required to invoke node and npm on your command line)
- Git client (Even if we are not using this directly now, but command line tool uses it internally to download some of the required assets while creating new project)
- Android SDK
- Apache Cordova (Really, I like this name…!!!)
- Apache Ant (Required while building your app)
- PhoneGap Developer App (Required for testing on your device. You can download it from your Play Store/App Store)
Let’s start working:-
Step 1: Install PhoneGap Desktop App
This is an simple installation like any other software. Just click on Next, Next and done…
Step 2: Install Node.js
Open installer and follow the instruction.
Step 3: Installing git client
Double click on downloaded installer and follow the instructions.
Step 4: Install Android SDK
Download the required installer and complete the installation.
Step 5: Installing Cordova
Execute following command in command line tool with administrator access.
For OS X and Linux:
$ sudo npm install –g cordova
C:\> npm install –g cordova
Step 6: Configure Apache Ant
Download Apache Ant from http://ant.apache.org/bindownload.cgi and extract the contents of the compressed file in any folder say D:\ApacheAnt\
Now add ant bin folder (D:\ApacheAnt\bin\) to PATH environment variable and create new environment variable ANT_HOME with value as D:\ApacheAnt\
Step 7: Installing PhoneGap Developer App
I hope you have already installed PhoneGap app on your device, if not then following is the link for Android devices.
Everything is set. Now start PhoneGap desktop app and click on add new project.
Now click on the RUN button, it will show a message at the bottom saying “Server is running on http://192.168.X.X:XXXX
Now connect your device to your machine if your machine and device are not in same network.
Open PhoneGap app, enter the above IP as below and click Connect.
Voila!!!! Your demo application should be running on your device.
Congratulations on successfully completion of all the steps.
In the next post we will create some basic application and deploy it on your device.
If you enjoyed the above article then please put your comments below and don’t forget to share.