Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Tip for PhoneGap Users - Modify the WWW template

DZone's Guide to

Tip for PhoneGap Users - Modify the WWW template

· Web Dev Zone
Free Resource

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

Now that I've gotten comfortable with PhoneGap's command line I'm finding myself much more productive when building quick demos. The previous link will tell you more, but as a quick example, this is how I'd quickly dump out an IOS project.

ioscreate foldername org.camden.randomdemox RandomDemoX

"ioscreate" is not the name of a PhoneGap binary, but simply a symbolic link to the create binary from the PhoneGap iOS directory.

I then CD into the folder, run "subl www" to open the www folder in Sublime, and run "cordova/build && cordova/emulate" to run the build and emulate commands. This pops open the new application in my iOS simulator.

All of this takes about 2 seconds and works great, except for one small nit. By default, the new project has this fancy HTML.

You can't see it - but the green "Device Is Ready" is pulsating. It's very hypnotic.

What this means is that I actually spend more time "cleaning" the HTML, JavaScript, and CSS then I do actually creating the new project.

Luckily there is a quick fix for this. Given your desired platform, go to where you installed PhoneGap and you will see a "bin" folder and beneath that, a "templates" folder. There should be one folder underneath it.

See the www folder? Just edit the contents within there to your liking and the next time you create a project, your modifications will be used. Here's my version.

Ok, that's kinda boring, but I've got a nice blank HTML, JS, and CSS file ready to go in my editor.

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}