Sunday, December 18, 2011

HTML5 vs. Native – The Future of Enterprise Mobile Apps

Hydrogen Car
Some 15 years ago, I first heard about Hydrogen-powered cars. The idea was simple and perfect: a clean, free, inexhaustible energy source to replace the dirty, expensive, limited supply of fossil fuels, with pure water as its only by-product. Sadly, the industrial process required to compress Hydrogen into a usable liquid currently creates more pollution than driving on Regular Unleaded. 15 years have passed, and despite their many enthusiastic supporters, Hydrogen-powered vehicles are still not close to going into mass production.


I'm reminded of this when I read the buzz about HTML5 for mobile apps. It certainly sounds like a great solution to the problem of multiple mobile platforms requiring multiple application development efforts and skill sets. However, all the evidence points to the fact that HTML5 simply isn’t ready yet to replace native apps. Apple, Google, Facebook, Microsoft, Amazon, and many others claim to be ardent supporters of HTML5, yet they continue to fund and promote the development of native mobile apps.


To turn the dream of HTML5 for mobile into reality, as an industry and a community of developers and consumers, ‘our ships must all sail in the same direction’. This is not yet the case, however. For example, the World Wide Web Consortium (W3C) will not finalize the definition of the HTML5 standard for several more years, so there is no clear agreement as yet about what in fact constitutes a genuine HTML5 application. Similarly, the multiplicity of Web browsers that are currently being used by smartphones results in inconsistent performance of HTML5 Web-based apps due to a variety of compatibility issues.

There are many who believe that HTML5 will never fully replace native apps, and will never be able to tap into the native hardware capabilities of the different mobile devices in the way that truly native apps can. The following table shows various shortcomings of HTML5 in its attempt to support a range a features on different devices that are currently supported by native apps:

HTML5 compatibility on mobile and tablet browsers



Feature Safari on iOS Android Browser BlackBerry Browser Nokia Browser Internet Explorer Opera Firefox webOS Browser
Version tested
iPhone, iPad
Phones
(1-2.3, 4.0)
Tablets (3.0+) Phones Tablet Meego - Nokia N9 Symbian Windows Phone Mobile Mini Android
Minimum version tested 3.2 1.5 3.0 5.0 1.0 1.2 ^3 9 11 5 6 1.4

Application Cache
W3C API
Offline package installation.

true true
2.1+
true    true
6.0+
true true true true true

Web storage
W3C API
Persistent and session storage.

true true
2.0+
true true
6.0+
true true true true true true

Web SQL storage
W3C API (no active)
Persistent SQLite storage.

true true
2.0+
true true
6.0+
true true true true

Geolocation
W3C API
Geolocation & tracking using GPS, cells or Wi-Fi.

true true
2.0+
true true
6.0+
true true true true true true

Multimedia
W3C API
Video & Audio Players

true true
2.3+
true true
7.0+
true true true true true true

Server-Sent Events
W3C API
EventSource pattern to mantain the connection to the server open

true
4.1+
true true true

Web Sockets
W3C API
Newbidireccional protocol over HTTP

true
4.2+
true
6.1+
true true true
7+

Web Workers
W3C API
Threading and background process communications

true
5.0+
true
6.0+
true true true true

Canvas API
W3C API
2D Drawing API

true true true true true true true
Anna+
true true true true true

SVG
W3C Working Group
Scalable Vector Graphics

true true
4.0+
true true true true true true true true true

Motion Sensors
W3C Standard
Accelerometer, Gyroscope, Magnetometer

true
4.2
true
4.0+
true true true
moz (custom)

HTML5 Form Virtual Keyboards
W3C Standard
Text Inputs with different keyboards

true true true true true
Anna+
true true true

HTML5 Form New Controls
W3C API
At least: Date, Time, Month, Range

true
5.0+
true true true

Touch Events
W3C API
touchstart, touchend, touchmove, touchcancel

true true
2.1+
true true
6.1+
true true true
(android)
true

CSS 3 Basic
W3C Standard
opacity, backgrounds, text effects, rounded corners

true true true true
6.0
true true true
Anna+
true true true
partial
true true

CSS 3 Transforms 2D
W3C Standard
rotate, translate, scale, skew, matrix

true true
2.0+
true true
6.0
true true true
Anna+
true true true
partial
true true

CSS 3 Transforms 3D
W3C Standard
scale3d, translate3d. Perspective, Backface

true true
4.0+
true true true

CSS 3 Transitions
W3C Standard
Animations between two states

true true
2.0+
true true
6.0
true true true
Anna+
true true true

CSS 3 Animations
W3C Standard
Animations with keyframes

true true
2.0+
true true
6.0
true true true
Anna+
true true

Viewport definition
W3C API
Meta tag support.

true true
supports target-densityDpi
true true true true true
Anna+
true true
supports css & meta
true true

Position: fixed support
W3C Standard
Ability to mantain an element fixed in the viewport while scrolling / zooming

true
5.0+
true
2.2+ & non scalable viewport
true
3.1+
true
7.0+
true true

Remote Debugger
Ability to attach a remote debugger, such as Web Inspector

true
weinre (inspector)
true
weinre (inspector)
true
weinre (inspector)
true
7.0+
true true
DragonFly
true
weinre (nspector)

WebGL
Khronos Group API
3D Canvas for the web

true
2.3 only on Sony Xperia
true
2.0 beta
true

XMLHttpRequest 2.0
W3C API
AJAX 2.0: upload files, progress

true
5.0+
true
4.0+
true true

Navigation Timing API
W3C API
Performance events for WPO

true
4.0+
true
4.0+
true true
7+

Notifications API
W3C API
Background alert notifications

true
custom code

Network Information API
W3C API
Connection Type: 2G, 3G, 4G, WiFi

true
2.2+
true

File API
W3C API
Opening local files through input type

true
4.0+
true

CORS
W3C API
Cross origin Resource Sharing, for cross domain AJAX request

true true
4.0+
true true

HTML Media Capture
W3C API
Taking pictures, record video and audio from an input file type

true
4.0+
true

IndexedDB
W3C API
Agnostic database system (replacement for Web SQL)

true

*This comparison table originally appeared here

Certainly for now, native apps still run better, faster, and more predictably than browser-based apps. Add to this the security concerns raised by HTML5 Web-based apps that have yet to be resolved, and a picture emerges of a solution whose time has not yet come.


The automobile industry dreams of a future with 100% pollution-free, renewable energy sources, but in the meantime is developing and implementing a wide range of alternative approaches to reducing carbon emissions and increasing efficiency in the cars of today. Similarly, many leaders in the software industry look to a future of a single, universal, Web-based mobile application development standard. But while the debate about HTML5 vs. native mobile apps rages on, right now there is a very real and urgent need for a multi-platform, multi-device mobile solution that addresses the needs of developers and consumers alike.


Magic offers just such a solution, with a single tool and a single paradigm for developing and deploying mobile applications. Developers don’t need to compromise on functionality for the sake of unified development, and they don’t require a specialized skill set or device-specific knowledge to create mobile apps that run natively on all major mobile operating systems.
For more information about Magic Software’s mobile offering, visit: www.magicsoftware.com.