From MozillaWiki
Jump to: navigation, search

What is GeckoView

GeckoView is an Android library project that allows third-party developers to use Gecko as an Android View in their own applications. GeckoView is similar to Android's built in WebView, but it is not a drop in replacement for WebView.

Note that GeckoView is not quite ready to be used in a production environment.

Current API documentation can be viewed here:

Using GeckoView

Add Nightly taskcluster repo to your build.gradle

repositories {
    maven {
       url ''

Add geckoview to dependencies

Again, in build.gradle

dependencies {
    implementation 'org.mozilla:geckoview-nightly-armeabi-v7a:+'

This will always use the latest Nightly in the repository. As GeckoView development continues, we will have Beta and Release repositories that have the expected version names (61.0.0, etc).

Loading a page in GeckoView

You can now use GeckoView your app by including the following in a layout XML file:

  android:layout_height="wrap_content" />

You can then load a page in your Activity with:

onCreate(...) {
    // Find the GeckoView in our layout
    GeckoView geckoView = (GeckoView) findViewById(;

    // Attach the GeckoView to a new GeckoSession
    GeckoSession session = new GeckoSession();;

    // Load a URL

Example App

GeckoViewExample is an example app that lives in mozilla-central and lets you easily exercise GeckoView. You can build/install it with the following gradle command:

mach gradle geckoview_example:installLocalWithGeckoBinariesNoMinApiDebug

You may find it easier to do this from Android Studio, where geckoview_example appears as a module.

Firefox Focus also has a build variant that uses Gecko. To build, check out the Focus code from and follow the instructions. The only difference is you need to select one of the Gecko build variants from the Android Studio 'Build' menu.

The Gecko-related code for Focus lives in


GeckoView bugs 🐛