Last week Google released Android 4.4 — codename KitKat.For web developers there is a big change — one we’ve all been waiting for. The build-in WebView has been updated to use Chrome. So, this seems like a good moment to take a closer look at the Android browser and the WebView.
A little bit of history
Traditionally Android provides a rendering engine based on WebKit called the WebView. The Android browser — simply called Internet — uses the WebView. But other browsers and any application that need to render HTML can use it too, including apps that have been build using web technologies with PhoneGap.
Unfortunately the standard WebView is pretty bad. It has quite a few rendering issues and missing support for established web standards. And because the Android browser uses the WebView it too has been pretty bad. The last major update it got was with Android 4.0.
That is why vendors have actually started making ‘improvements’ to the WebView they ship on their phones or tablets. They took the open-source WebView and made quite a few improvements. But also introduced quite a few new bugs and other issues. Sometimes they just enabled features that were deliberately disabled in the standard WebView, because the current implementation was not yet ready for public use. Sometimes they started using updated version of WebKit. And sometimes they implemented new features on their own, but almost nobody shared the work they did on the WebView and contributed it back to Android itself.
So we ended up with devices that use the standard unmodified WebView and devices that use their own modified version. As a result you can take 5 different phones using the same Android version and end up with 5 different HTML5test.com scores. This is a complete nightmare if you want to test your site or webapp on Android. If your site works with a particular version of Android on one phone, there is no guarantee it will work on another with the same version. Let alone on a different version!
The Android browser is still relevant
The common wisdom is that with recent versions of Android, the Android browser has been replaced with Chrome. While this is true on Nexus devices, this is certainly not the case for other devices.
The open source version of Android does not include the Chrome browser and still uses the old Android browser. And almost all non-Nexus devices are based on the open source version. I haven’t found a single non-Nexus device that does not have the Android browser in one form or another. And even if Chrome is pre-installed, the Android browser is often still the default browser.
And even if you have a Nexus device without the Android browser, the default WebView is still there. Any application that wants to render HTML still uses the default WebView and does not care if Chrome is installed or not.
Even more variations
So we have the Android browser which either uses the default WebView or one of a dozen modified versions of the WebView. But we also have another variation we haven’t covered yet.
Every Samsung device released after the Galaxy S III uses an improved version of the default WebView. This includes the S4 and later, but on these more recent devices the Android browser does not use the WebView anymore. What Samsung did was modify the Android browser so it can use the rendering engine from Chromium.
The first version of this new Android browser was used on the S4 and all of its variants.This first attempt is based on Chromium 18 and as of the Note 3, it has been updated to use Chromium 28.
On the Galaxy S III, the Tab 2, Tab 3, Note 8.0, Note 10.1 and many others we have the following rendering engines:
- the modified WebView — used by the Android browser
- Google Chrome (not installed by default on all)
On the Galaxy S4, S4 Mini, S4 Zoom and S4 Active we have:
- the modified WebView
- the Android browser which uses Chromium 18
- Google Chrome itself
So on the Note 3 and Note 10.1 (2014) we have the following rendering engines:
- the modified WebView
- the Android browser which uses Chromium 28
- Google Chrome itself
Just one more complication: it seems like Samsung is even shipping different variants of their Chromium 28 based Android browser. The Note 3 does not support the WebAudio API, while it is available on the Note 10.1 (2014).
Android 4.4 makes it even more complicated
With the release of Android 4.4, Google has replaced the default WebView with a new WebView based on Chrome 30. While this may not have much impact on Nexus devices — it already uses Chrome as the default browser — it does matter to vendors that still ship the Android browser.On those devices the Android browser will suddenly be using the rendering engine from Chrome 30, which is an enormous improvement.