How to setup a PhoneGap 3.4 App in 5 min

As of about a year ago I switched over from native development to almost exclusively PhoneGap. It makes development faster, easier, and more fun. This article outlines how to create a fast and beautiful PhoneGap 3.4 app in 5 min. The steps should be the same for other 3.X versions of PhoneGap. You can also use ‘cordova’ instead of PhoneGap, PhoneGap is just the name of Adobe’s additional offerings on top of cordova. Thanks to phoneGap’s new developer app (available on most major app stores) you no longer need to setup the native Dev environment first.

Summary of StepsjqueryMobileFlat

  1. Install or update PhoneGap
  2. Create a new PhoneGap project
  3. Download my template folder. (Includes FastClick and jQuery Mobile UI)
  4. Build your app!
  5. Done

Steps in Detail

1. Download and install PhoneGap
If you don’t already have PhoneGap installed on your computer PhoneGap has a very simple tutorial you can follow:

*Update existing PhoneGap installation:

sudo npm update -g  phonegap

2. Create a new project.

# Create a new project 
# phonegap create [folder-name] [namespace] [project-name]
phonegap create hello com.example.hello HelloWorld

# Add platforms you want to develop for
#(You must already have the environment for this platform setup.)
cordova platform add android

3. Download PhoneGap Template

I have created a template folder that has FastClick and jQuery Mobile Flat already setup for you.

# Clone or download my template from this git repo.

# Copy content into the www folder into your PhoneGap project

If you want to learn more about the two libraries I’ve included checkout here:
FastClick: Removes 300 ms click delay in mobile browsers
jQuery Flat: Makes your app more mobile friendly and super pretty.

4. Done.

Now you just need to build your app and try it out.

# Build your app for your platform.
phonegap build android

# Now look into \platforms\android for your built app.

To read more about my views on PhoneGap you can check out some of my other articles in my blog.

Leave a Reply