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

By Peter Wayner, InfoWorld |  Development, HTML, mobile apps

Apple's iOS has a nice ability to bookmark websites by turning them into icons on the home screen. The user just needs to tap the Action button when viewing a page in Safari, then choose Add to Home Screen from the menu that appears. (The Action button's icon used to be a plus sign but was recently changed to an arrow emerging from a rectangle.) You can have an app icon appear for this app on the home screen (rather than a thumbnail image of the website's page) by creating a 48-by-48-pixel or larger PNG icon file and referring to it in the Web page's header using the <link rel="apple-touch-icon" href="/iphone-icon.png" /> statement.

Likewise, Android 2.1 and later can put a bookmark on its home screen and attach what it calls a launcher icon using the same header code as iOS uses. (A sustained tap on the bookmark opens up a menu that offers the chance to add a shortcut to the home screen.)

Handling performance issues through hybrid apps Having the entire app on the Web server means the performance depends heavily on the quality of the device's Internet connection. Thus, a Web app won't usually work well if all the parts are kept on the server.

One solution to the performance issue is to include a cache manifest, an HTML5 enhancement that specifies which parts to keep on hand. A well-designed architecture can keep all the useful parts within reach and still erase the dynamic data that's not in use.

The manifest can also be combined with local databases to store local information. This technique works with modern HTML5 browsers as well.

Another solution to the performance issue is create a hybrid app by wrapping up the HTML/JavaScript/CSS code in a native app that simply loads the HTML into a WebView. The result is an app that installs like a native app but maintains much of the same look and feel as the HTML code running in the browser. It's not always the same, but it is for most cases.

However, bundling the HTML with a native wrapper means that the wrapper must be developed in each device's native development enviroment (not a horrible burden) and the resulting app must be delivered through the traditional app store channels, with all of the pleasures and pains that they bring for developers. In the past, Apple fretted about hybrid apps like this and often blocked them, but recently it's been much more open to this development model.

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.


Originally published on InfoWorld |  Click here to read the original story.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness