Open-Source Wikis

/

Gecko

/

Apps

/

Firefox for Android (Fenix)

mozilla/gecko-dev

Firefox for Android (Fenix)

The modern Firefox for Android browser, codenamed Fenix, is a Kotlin app that embeds Gecko via GeckoView. It replaced the old Fennec app around 2020.

Purpose

Fenix is a native Android app with its own Compose / Fragment / Activity UI. It uses GeckoView for everything related to web content (rendering, navigation, JavaScript). The app's core is split between Mozilla Android Components (a library of reusable browser building blocks) and Fenix-specific UI/feature code.

Directory layout

mobile/android/
├── geckoview/                    # The embedding library (Kotlin + JNI to Gecko)
├── geckoview_example/            # A bare-bones example app using GeckoView
├── android-components/           # Reusable browser components (browser-engine, browser-toolbar, etc.)
├── fenix/                        # The Firefox for Android app
├── focus-android/                # Firefox Focus / Klar (privacy-oriented sibling)
├── exoplayer2/                   # Vendored ExoPlayer for media
├── components/                   # Misc shared Android components
├── gradle/                       # Gradle wrappers and configs
├── docs/
└── ...

Key directories

Architecture

graph TD
    Activity[HomeActivity / BrowserActivity] --> Fragment[BrowserFragment]
    Fragment --> EngineView[GeckoEngineView]
    EngineView --> GVSession[GeckoSession]
    GVSession --> JNI[GeckoView JNI layer]
    JNI --> Gecko[Gecko Content Process]
    Fragment --> Toolbar[BrowserToolbar]
    Activity --> Store[BrowserStore<br/>Redux-like state]
    Activity --> ServiceWorkerR[Sync, Sync, Glean, Nimbus]

The Mozilla Android Components team maintains a unidirectional state architecture (BrowserStore and BrowserState) inspired by Redux. Fenix consumes this store and renders Composables / Views from it.

Build

The Android build is driven by Gradle but starts from mach:

ac_add_options --enable-application=mobile/android
./mach configure
./mach build
./mach package
./mach android-emulator   # optional: spin up an emulator
./mach gradle :fenix:app:assembleDebug

The resulting APK lives under <objdir>/gradle/.../fenix-*.apk.

Components used by Fenix

A non-exhaustive list of features that come from android-components/:

Component Purpose
browser-engine-gecko Bridge between concept-engine and GeckoView
browser-state / browser-store Redux-style state
browser-toolbar Address bar Composable
browser-tabstray Tabs tray UI
browser-session-storage Tab persistence
browser-icons Site favicons
feature-tabs, feature-search, feature-session, feature-prompts, … Reusable feature modules
service-glean, service-nimbus Telemetry and experiments
service-firefox-accounts Sign-in plumbing

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Firefox for Android (Fenix) – Gecko wiki | Factory