I’ve been trying to figure out PhoneGap for about a week now and I’m just now starting to understand it because the documentation is sparse.
This is my understanding:
A PhoneGap application is a iphone safari window without the UI stuff: no bookmark bar, no scroll bar, nothing. Just a plain white canvas.
The iphone UI stuff that you see in a PhoneGap application are not really cocoa. It is HTML, javascript, css, and webkit special features (animations) cobbled together to look like a native iphone cocoa app. You could make it look like a regular web page if you wanted to. You have the option to do standalone (offline) apps or web-based apps.
I am finding that the best starting point is to look at apple’s safari dev center to get access to the special features that safari has for the iphone like HTML5 support and the CSS3 animations.
The phonegap js library provides hooks into iphone-specific functions like touch, accelerometer, and GPS. If you do not need that functionality you do not need to use the js files.
As far as I can tell the best thing to do is make a web app first then point your phonegap application to it using the configuration file (Settings.plist). Your phonegap app is essentially a safari window that depends on your HTML and CSS to provide all of the UI because this is a safari pane, it has no navigation or address bar, or anything.
You make a regular web site but it can have access to special iPhone features using the javascript library (phonegap.js) they provide. Other stuff like SQLite support is built into safari.
Look at the Apple Safari Dev center (http://developer.apple.com/safari/mobile.php) to figure out the interesting things that Safari can do. Do not bother looking at iphone dev, your phonegap app is really a Mobile Safari app.
The examples they have are kind of confusing because some of the stuff looks like native cocoa applications. It is not native cocoa, they are using HTML, CSS and Javascript to make stuff that looks exactly like a cocoa app but it’s actually a web page. What amazes me is a guy was able to make that blocks game in HTML and Javascript.
