PhoneGap: Use the iPhone SDK's Features from HTML / JavaScript

By
On October 26, 2008

phonegap.png

PhoneGap is a free and open source framework and development tool that opens up the iPhone’s SDK to Web developers – allowing them to access features such as the accelerometer and geo-location tools directly from HTML and Javascript powered Web pages. Support for accessing the camera and “vibration” are pending. The source is directly available from a Github repository.

The catch? Due to the features used and integration required, Web sites that use PhoneGap’s features need to be packaged up into Webkit-powered Site Specific Browsers. Essentially, your site becomes a app that includes a Web browser that browses your site and which has access to PhoneGap’s features.

As well as its official site, PhoneGap also has a Google Group and a Twitter feed (@phonegap).

0 responses to “PhoneGap: Use the iPhone SDK's Features from HTML / JavaScript”

  1. Pete Forde says:

    Oh, this is triple-awesome.

    I have to do some more investigation, but I suspect that the WebKit SSB’s can be set up to allow increased circumvention of the Same Domain Policies which prevent Ajax applications from POSTing between sites in current browsers.

    What this means is that using something like Jester, you could build an iPhone app that has full access to the accelerometer and can move fully bi-directional REST around like a champ, in HTML + JavaScript.

    I posit that as lightweight iPhone Javascript toolkit DSLs continue to emerge, the need for most application developers to use much Objective-C will be quite small.

  2. Lee Barney says:

    QuickConnectiPhone is a different framework with a different approach. If you are looking at phoneGap you should also check out QuickConnectiPhone.

    https://sourceforge.net/projects/quickconnect/

    It is also free and open source and has been under development longer than PhoneGap. It provides a modular app development library that includes modules for AJAX and SQLite database access. It also includes a module that allows you to embed Google Maps in your application. No longer do you need exit your app to show a Google Map. Examples are included in the download for GPS, accelerometer, vibration, recording and playback, as well as other capabilities.

    It comes with an installer that adds QuickConnect templates to Xcode for both iPhone applications and Mac applications. You can now use the same framework for both your iPhone and Mac development.

    QuickConnectAndriod and Linux/Nokia are in Alpha right now and soon will be available to the public in Beta soon. You will be able to develop one application in JavaScript and then deploy it to multiple platforms.

    The development blog is at https://tetontech.wordpress.com/

  3. Ken Law says:

    MotherApp (https://motherapp.com/) does something similar, but we convert the HTML to Objective-C instead of just embedding a web browser inside the app. This means:
    – Professional UI: All the UI widgets (such as buttons, tabs) are based on the iPhone SDK instead of emulated by web techniques.

    – Camera: Use camera to upload images to server.

    – Cache: Use cache to improve the performance and allow people to use the app offline.

    Our product is still very new and your comments are most welcome.

  4. Jon says:

    seems like you can only access features like accelerometer inside an app. Is there a way to do it using one of your frameworks via HTML/JS only?

  5. I’m with Jon. Is there any way to access features from plain old web pages. I’m guessing no, since that would mean you wouldn’t (couldn’t) be able to charge for apps at a device sponsored app store. But maybe I’m wrong. If so, I would love to see some simple examples? Its a great idea. Hope to exploit it as a web dev.