If you have used WebView in any of your Android projects, you might know that it has some limitations. Now you have a choice as GeckoView can do everything it can and more. Android offers a built-in WebView, which applications can hook into in order to display web pages within the context of their app.
However, Android’s WebView is not really intended for building browsers, and hence, many advanced Web APIs are disabled. Furthermore, it is also a moving target: different phones might have different versions of WebView, all of which your app has to support.
GeckoView is the rendering engine inside the latest Firefox for Android browser, named as Firefox Preview. In fact, Preview is a combination of GeckoView and Mozilla Android Components.
If you think of GeckoView as the rendering engine and all of the other internals a browser needs, then Android Component is the UI. Mozilla is suggesting that you can make your own browser using GeckoView and your own selection of components. It also has released something called “Reference Browser” which you can use as a starting point for your own browser and somewhere for Mozilla to test its own development ideas.
End users are now faced with a choice of the original Android Firefox called Fennec, which isn’t GeckoView-based. but does use it for some things and Firefox Focus, a privacy enhancing browser which does use GeckoView. Mozilla is going to have to make this simpler. My guess is that Focus and Fennec will eventually disapear. Mozilla has already announced a feature freeze on Focus.
While there are some advantages to Firefox Preview, its 20% faster load times, for example, the most important aspect is that Mozilla has provided a different way of creating web based apps. To quote:
- Full-featured: GeckoView is designed to expose the entire power of the Web to applications, and all that through a straightforward API. Think of it as harnessing the full power of Gecko (the engine that powers Firefox), while its API is WebView-like and easy to use.
- Suited for apps and browsers: GeckoView is particularly suited for building mobile browsers, but it can be embedded as a web engine component in any kind of app.
- Self-Contained: Because GeckoView is a standalone library that you bundle with your application, you can be confident that the code you test is the code that will actually run.
- Standards Compliant: Like Firefox, GeckoView offers excellent support for modern Web standards.
GeckoView is based on the original Gecko but it has been repackaged as a more modular Android app. Mozilla seems to be serious about continuing the development of GeckoView but, with Chrome installed by default, it seems unlikely that Firefox will ever take a substantial share of the Android browser market. Most end users are too lazy and uninterested to go to the trouble of trying another browser.
It also seems likely that GeckoView has a better chance as a better WebView. Mozilla has a difficult task of covering such a wide area of application with comparatively limited resources.
Developers can now do more and better than WebView. Let us hope that this isn’t another failed project in the making.