PhoneGap: A Shortcut to App Development

ott 9, 2012 by     1 Comment     Posted under: Mobile Solutions




















I don’t expect you to buy this statement without first trying PhoneGap, yourself. However, I encourage you not to yield to hype and advertising. PhoneGap is a framework for mobile development with many merits and one original sin: it’s designed to depend upon mobile browsers. That’s the only issue but it’s a big one. Worse yet, it’s an issue that PhoneGap developers can’t seem to be able to alleviate.

You can use PhoneGap to build applications for seven mobile platforms: iOS, Android, BlackBerry, Windows Phone, Symbian, webOS and Bada.Mobile applications are always built by following the same pattern:

1)     Create an HTML web application, possibly HTML5, made up off client pages and JavaScript. Pages are free to use Ajax to call into remote endpoints, and CSS to adjust appearance. Additionally, pages may use local storage. Finally, pages may link any JavaScript library you like, i.e., Sencha, jQuery and family micro JavaScript libraries.

2)     Link a PhoneGap provided JavaScript library, which offers a common scriptable interface to some device capabilities. This allows you to interact with the device via JavaScript and access things like contacts, camera, and sensors.

3)     Get the project template for the platform of interest. The project template links PhoneGap binaries for the platform. In most instances, you’ll need to tweak the script and markup of the HTML pages.

4)     Compile and run and it. It normally works as expected.

You can reuse the same HTML client application across multiple platforms but have to manage multiple projects individually. This means that in case of changes, you must manually update all files across multiple projects.  Then, you must repackage the application and release it to the store again as an update. It’s impossible to update the app by simply updating the HTML code.

Once in action, the PhoneGap application runs within a web view, therefore, it is at the mercy of the browser. How critical is this aspect?

  • iOS: Safari mobile is reasonably fast, at least on most modern iPhones and iPads. PhoneGap apps work mostly well on all iOS devices.
  • Android: There are so many devices out there, you can hardly have just one HTML-based app. Acceptable only on high-end devices.
  • Windows Phone: Not a realistic option. Let’s try again with Windows Phone 8.
  • BlackBerry: Barely acceptable only on high-end devices, running most recent versions of the operating system (6.0+).

What about other platforms? Don’t expect to find fast and modern browsers on Symbian and others. However, for these less popular platforms, PhoneGap represents an interesting shortcut as opposed to gaining programming skills from scratch. PhoneGap is hardly the main path for mobile development, on any supported platform, but it can be a nifty shortcut.

Dino Esposito

CTO of a company that provides software and mobile services to professional sports, Dino is a well-known ASP.NET expert who has written several popular books, including Microsoft .NET: Architecting Applications for the Enterprise, Programming Microsoft ASP.NET, and Programming ASP.NET MVC, all for Microsoft Press. His latest book, Architecting Mobile Solutions for the Enterprise has just been published by Microsoft Press and is available for sales.

More Posts

Follow Me:
Twitter

1 Comment + Add Comment

  • “You can reuse the same HTML client application across multiple platforms but have to manage multiple projects individually….It’s impossible to update the app by simply updating the HTML code.”

    It is not true. It’s not difficult to organize an environment with just one HTML+CSS+JavaScript project to compile against the platforms you need.
    There is a proposal to make it official in Cordova (the project behind PhoneGap): http://wiki.apache.org/cordova/UniversalProjectProposal

Got anything to say? Go ahead and leave a comment!