This flexibility is spawning some hybrid frameworks. One of the most fascinating is PhoneGap, a cross-platform collection of tools that wraps around a Web application and turns it into a stand-alone application. The project has constructed native wrappers for the major smartphones, and in theory it's possible to write one application that works on all of them.
"There are not necessarily apps that should be written using PhoneGap instead of being written natively," explains Dave Johnson, the PhoneGap developer responsible for the BlackBerry part of the code base. "But certainly PhoneGap makes it easier to do things like converting an existing Web app to run on the iPhone or Web mashups that might mean a lot more work if written for the iPhone natively."
Johnson explains that some areas of the underlying API like the OpenGL display layer are out of reach of the PhoneGap model because of performance. If you want to build a fast, three-dimensional game, native code is the only solution.
There are also trickier challenges to working with PhoneGap. A clever feature can turn into a dangerous bug if it opens up some of the underlying iPhone API to any random Web site.
Johnson rejects the idea of building a PhoneGap browser for general use because it could expose these features to dangerous manipulation. It would be possible to generalize the project, so any Web site could activate the features just by including the project's gap.js file in the HTML.
"We would be hesitant to suggest such a thing because of security concerns," Johnson says. "Opening up the iPhone APIs to any Web site could clearly pose a security threat."
Stars of the small screen
Johnson notes that the group is actively searching for volunteers to port the code to other phones. "We are looking for people to take up the cause of Windows Mobile and Symbian," he says. "On Symbian we are hoping to use S60WebKit, which is their version of the same WebKit browser as on Android and iPhone." It may be a bit trickier to work with Windows Mobile phones, he says, but he thinks there might be some possibility to link in libraries from Firefox.
"There are limits to how far you can go with this model," explains Ed Burnette, author of the book "Hello, Android." "If you need a high level of interactivity, immersive media, or access to local resources like disk space, then you'll need to use the native development environment for the device."
He adds, "I think it's telling that many popular Web applications such as Amazon, eBay, Facebook, and Twitter have been re-implemented as native smartphone applications. The Web versions work OK, but the user experience is better with an application that is customized for the device in a way that Web apps simply can't be today."