Android 5.0, HTML5 and WebView

by    Nov 30th, 2015

Posted In:

While the recent iOS 8 update did a lot to improve HTML5 on Apple devices, Google just announced Android 5.0 Lollipop, and it has some surprises! he Android 5.0 web view (that’s the control which runs your games in native apps, as used by PhoneGap) now also supports WebGL, Web Audio, and (going further than iOS 8) WebRTC.

TJ VanToll in his article What Android 5.0’s Auto-Updating WebView Means for Mobile Apps (http://developer.telerik.com/featured/android-5-0s-auto-updating-webview-means-mobile-apps/) talks about interesting implications about this:

Security

Even though Android KitKat switched to a Chromium-based WebView, the WebView itself was bakedin to the Android OS. This means that each Android 4.4.x version has a specific version of Chromiumits WebView uses, specifically Chromium 30 on Android 4.4.0–4.4.2 and Chromium 33 on Android 4.4.3–4.4.4.

From a security perspective this is troubling, because it means security vulnerabilities found in  Chromium require an operating-system-level update to fix, which is particularly problematic in the Android world where OEMs aren’t exactly known for their swift upgrade cycles.

New APIs and features are available immediately

While security updates are certainly important, they’re not the sort of thing most developers get excited about. What developers like are new features, and auto-updating WebViews promise to bring those features to developers faster. For instance, Android 5.0’s upgrade to Chromium 37 alone gives hybrid developers new access to WebRTC, WebAudio, WebGL, Web Components, and more.

The end of Android WebView fragmentation?

The final implication of auto-updating WebViews is probably the biggest one: a move to end WebView fragmentation. It’s no secret that Android has been trying to rein in fragmentation over the last few years, and increasingly their tactic has been moving functionality to Google Play Services— a set of services that run on Android 2.3+ and, most importantly, update in the background without user intervention. This means that although only a small fraction of Android users are on the latest OS version, 93% of Android users have the latest Google Play Service APIs (as of June 2014). The Google Play Services shift has been important enough that many believe that Android fragmentation is no longer a problem.

 

Android 5.0 is going to be a great platform for HTML5 games, whether they’re in the browser, saved as home screen web apps, or built with PhoneGap for the Google Play Store. I’m really impressed Google already got the web view auto-updating, and Chrome keeps on getting better as ever on its rapid release cycle. I’d say it looks like Android is the platform with the most exciting future for HTML5 developers.