Mobile is overtaking the desktop as our primary computing platform. For the IT leader, this technology wave presents amazing opportunity, yet significant challenge. Mobile requires new thinking about how data is accessed and presented, how applications are architected and what tools should be used.
One of the more common issues is determining which technology to choose for the development of the client-facing portion of the applications themselves; including whether to develop native mobile apps, Web-based apps using HTML5, or create a hybrid app.
While I don’t think HTML5 is the right approach in every case, I have seen it ruled out based on misinformation. So my goal is to clarify what HTML5 is (and isn’t) capable of so IT leaders can make an informed decision about the best choice for their projects.
Native Apps
By “native apps,” I’m referring to apps written with platform-specific tools, languages and frameworks. For example, iOS development is done in Objective-C, while Android development is in Java. Native apps are typically very robust, distributed through an app store that supports the platform and has full access to device hardware APIs.
The concerns with cross-platform native development are cost, consistency and distribution. Locating developers for each platform is difficult and expensive. Keeping codebases in sync across multiple teams is also a significant challenge. For apps distributed through app stores, you’ll have to consider content restrictions, approval delays and revenue-sharing.
Web Apps
By “Web apps,” I’m talking about mobile-optimized websites hosted in the cloud and accessed by end-users via a mobile browser on their device.
Mobile Web development allows the enterprise to leverage their existing Web talent, tools and techniques to build out a mobile Web effort. And because mobile Web apps are accessible on the Internet, there are no distribution complications.
There are three commonly raised issues about mobile Web that warrant discussion — offline support, performance and device access.
Offline Support
With HTML5, the Web’s dependency on a connection to the Internet has been broken. Web apps can now run offline in modern browsers thanks to HTML5 support for client-side storage of relational data, key/value data and static assets.
Performance
More often than not, I find that subpar Web app performance is a shortcoming of the programming, not the platform. People are still learning how to push HTML5 to its limits. As mobile Web skills improve — and as devices continue to get faster and more powerful — the gap between the Web and native experience is going to close.
Device Access
Because Web apps run in a mobile browser, they are “sandboxed” and have very limited access to the more sophisticated features of the device. While mobile browsers are gaining access to geolocation, accelerometer and orientation, they still can’t access things like the camera, microphone or compass.
Hybrid Apps
By “hybrid apps,” I’m referring to apps that have been built using the typical static assets of the Web (e.g., HTML, CSS, JavaScript files), but have been bundled inside a native app wrapper rather than hosted on a Web server. This approach is best exemplified by an open-source project called PhoneGap, which offers native app wrappers for all of the popular mobile platforms, as well as a unified JavaScript API that provides access to device features like the camera and microphone.
I find this to be a pragmatic and attractive cross-platform development approach for the following reasons:
1. Simplicity in development
You can have a single team working on a single codebase for many platforms. And this approach makes it fairly simple to deliver a consistently branded experience across all devices.
2. Access to native-device features
All major mobile platforms expose a JavaScript bridge between Web view and the surrounding code, which means JavaScript can be used to access the camera and other device features. PhoneGap unifies the JavaScript calls for each platform such that JavaScript call works the same on iOS, Android, Windows Phone 7, etc.
3. Range of distribution options
Hybrid apps can be distributed through platform-specific app stores but if app-store distribution becomes unattractive at a later date, the core app functionality can be released as a pure Web app. Access to some device features might be lost, but this is an acceptable trade-off in some situations.
Conclusion
As the mobile enterprise continues to boom and hardware complexity grows with a wide range of platforms, devices and audiences, there is no doubt that HTML5 will skyrocket in adoption. HTML5 Web-based apps offer the developer a “write one, run many” solution, addressing the many demands of today’s immediacy for remote communication, along with enhanced modern media capabilities that have become of increasing importance to both business and consumer.
Jonathan Stark is Mobiquity’s vice president of Application Architecture and the author of O’Reilly’s Building iPhone Apps with HTML, CSS, and JavaScript, as well as Building Android Apps. He’s behind “Jonathan’s Card,” an experiment in mobile social giving. He first blogged about his experiment in July 2011.