Escape the App Store: 4 ways to create smartphone Web apps

Proprietary, incompatible coding systems and app store controls can make mobile app dev too hard -- so try these HTML-oriented alternatives

1 2 3 4 5 Page 5
Page 5 of 5

For example, the PhoneGap open source framework bundles HTML into hybrid apps for five platforms: iOS, Android, BlackBerry, Symbian, and WebOS. The creators worked with Apple to scrutinize the code and as a result Apple will look only at the HTML and other features you add during its app approval process; it has essentially preapproved the PhoneGap code.

The big advantage is that the hybrid applications can dig deeper than an HTML app because the devices' security restrictions are less strict. Native (and thus hybrid) apps can access files and read the accelerometer directly, for example. Future versions of PhoneGap will also access the contacts, gyroscope, and other parts, Nitobi says, through JavaScript functions. You can also write your own native routines and integrate them.

The downside of the Web approach for mobile
Building smartphone apps with HTML is a fairly painless way to create cross-platform applications that can tap into the deeper parts of the native API. I've built several applications this way and found that they usually worked on both iPhones and Android smartphones with no changes.

Despite this ease, the results were not always perfectly consistent. I've found that Android places an arbitrary limit on the size of JavaScript files, so applications that worked on the iPhone would fail. There are dozens of such little differences that can get in the way.

I've also found that the hybrid apps start to fail in unpredictable ways as the code grows larger. Apps that work quite well on the debugger failed miserably when I moved them to the smartphones. Why? Memory is much tighter on the smartphone and there are fewer tools for controlling memory with JavaScript. Native coders can do a much better job sealing memory leaks than JavaScript programmers can, and that native advantage shows when the app gets big and starts to squeeze up against the limits of the smartphone.

The performance of HTML and hybrid apps can also be mediocre. Although there's no need to download the parts of the app, the speed of the app is limited by the JavaScript code. There's a price to pay for the relative ease of HTML apps. The performance is just not as good for native code, and the limitations of JavaScript and HTML become apparent when the size of the data grows too large. The JavaScript interpreter is not so fast, and mobile developers must worry more about memory usage and limited processor power than those developing for desktop browsers.

Still many of the complaints of mobile developers who write in Objective-C or Java also revolve around juggling resources. The little handsets have so much less memory than desktops and it's always a challenge to deal with them, whether you're doing native or Web app development. Don't take the issues I raise as being reasons to try the Web app approach. After all, the several hours you might spend monkeying with CSS is nothing compared to the years that some people have devoted sweating with pointers and memory issues. For the hours of work they take, the HTML apps can be stunning successes.

This article, "Escape the App Store: 4 ways to create smartphone Web apps," was originally published at Follow the latest developments in software development and mobile technology at For the latest business technology news, follow on Twitter.

Copyright © 2011 IDG Communications, Inc.

1 2 3 4 5 Page 5
Page 5 of 5