Cefrium logo

Cefrium — CEF for Android

Full Chromium inside your native Android app: off-screen rendering to a pixel buffer, a version-pinned engine, total control of the network — the capabilities the system WebView does not have.

It is CEF — the framework behind Steam, Spotify, Discord and OBS, 100M+ installs on desktop — now on native Android, same C API.

Cefrium bundles the Chromium engine (~150 MB per ABI). Publish an Android App Bundle and each user downloads only their architecture — the same approach GeckoView and Flutter use.

Quickstart Guides Benchmarks Releases About API Docs Source Code Browser Samples Live Demo
Cefrium Browser Headless Render

Build what WebView can't

Most apps that show a web page are fine with the system WebView. Cefrium is for the things it has no API for — because Cefrium ships the whole Chromium engine, not a wrapper around the one on the device.

🖼

Render the web to an image or PDF, headless

OnPaint hands you the raw pixel buffer (BGRA) — no Activity, no Surface, no UI. Generate thumbnails, snapshots or PDFs of any page on-device. WebView has no off-screen-rendering API.

🎮

Embed live web inside your own rendering

Composite that buffer into a game, a video frame, an OpenGL or Canvas scene — web content as a texture you control. A platform WebView can only draw itself into its own view.

📌

One Chromium version, identical on every device

Pin the engine you ship. No "works on Pixel, breaks on Samsung", no waiting on OEM WebView updates — for regulated UIs, design tools, web games and reproducible automated testing. WebView is whatever version the device happens to have.

🔀

Intercept and rewrite every request

Headers, POST bodies, redirects, responses, custom schemes — full control via CefRequestHandler at every API level, for ad-blockers, content rewriters and offline proxies. WebView's shouldInterceptRequest is URL-only and weak on older devices.

🔌

Let web pages talk to real hardware

Web Bluetooth, WebUSB and Web Serial wired end-to-end — requestDevice() routes to a picker you draw via CefDeviceChooserHandler, for IoT dashboards, point-of-sale peripherals and lab instruments. The system WebView exposes none of these APIs.

🔑

Passkeys that actually work

WebAuthn runs end-to-end through the Android Credential Manager — navigator.credentials creates and uses passkeys with the system fingerprint/PIN UI, for passwordless login in your web app. The system WebView gives web content no passkey path.

What Cefrium does

🎥

Video & Audio

H.264/AAC via hardware MediaCodec. Surface rendering through Chromium's GPU compositor. Background audio with ForegroundService.

🛡

Ad Blocking

Network-level request interception via CefRequestHandler. EasyList (61K+ rules), auto-updated. The ad request never reaches the server.

Full Control

CEF C API on Android. Custom protocol handlers, off-screen rendering, JavaScript execution, request modification. Others wrap the system WebView; Cefrium ships its own Chromium — the same engine on every device.

📱

Two Rendering Modes

Surface mode for on-screen with video/audio. OSR mode for headless screenshots, PDF generation, server-side rendering.

🔗

JS ↔ Native Bridge

Page JavaScript calls your Kotlin/Java via window.cefriumQuery and gets an async response — built on CEF's message router. Plus an idiomatic Jetpack Compose API (CefriumView) and evaluateJavaScript.

📷

Device & Media APIs

Camera and microphone capture (getUserMedia), geolocation, and system media controls on the lock screen — each gated by a native Allow / Block permission prompt. Plus Print to PDF and HTML5 fullscreen video. New in 0.3.0.

🌐

Modern Web Platform

The full, current web platform — scroll-driven animations, view transitions, CSS anchor positioning, container queries, :has(), and WebGPU. Not whatever the device's WebView happens to ship. Open the live demo in any browser to compare.

🧩

The rest of the web platform

Payment Request, File System Access (read & write files, directory picker), WebOTP one-time-code autofill, Web NFC, the sensor and device-motion APIs, MediaRecorder/ImageCapture, BarcodeDetector and Web Speech — wired end-to-end and validated on device. New in 0.5.0.

📦

SDK AAR

Standard Gradle integration. Add the dependency and load a URL — no initialize() call needed (zero-config init; call it only to control timing). Two variants: full codecs and libre (FOSS only).

🔓

LGPL v3

Free as in freedom. Full source on Codeberg. Commercial licensing available for projects that need different terms.

Cefrium vs the alternatives

The four ways to put web content in an Android app, side by side. Cefrium is the only one that is embeddable AND its own pinned Chromium AND offers off-screen rendering. The honest cost is memory -- see the measured RAM row and the full benchmarks, which also weigh Tauri, Ultralight and Servo: measured where there is an Android engine to measure, documented honestly where there is not.

CapabilityCefriumWebViewGeckoViewCustom Tabs
Embeddable in your own UIYesYesYesNo (opens an external browser)
EngineChromium (own, pinned 149)Chromium (OS WebView, varies)Gecko (own, pinned)Chromium (Chrome, varies)
Off-screen rendering (pixel buffer)Yes (OnPaint)NoNoNo
Multi-process controlYesNoYesn/a (external)
Request interceptionCefRequestHandler (every API level)shouldInterceptRequest (limited)Content blocking / WebExtension (limited)No
WebGPU & Web Bluetooth / USB / SerialExposed (secure context)NoPartial (no Bluetooth / USB / Serial)No
Custom protocol / scheme handlersCefSchemeHandlerFactoryVia shouldInterceptRequestLimitedNo
JS ↔ native bridgewindow.cefriumQuery (async)addJavascriptInterface (security caveats)WebExtension messagingNo
Engine identical across devicesIdenticalVaries by OEMIdenticalVaries by Chrome
RAM, same page (measured)~240-260 MB~120-145 MB~180-205 MB~180-225 MB (Chrome proc)

RAM is the honest trade-off: on the same page Cefrium uses the most memory of the four (~1.3x GeckoView, ~2x WebView) -- the cost of carrying its own pinned Chromium and a real multi-process model. Custom Tabs is lighter only because it is not embeddable: it renders in a separate Chrome process you do not control. Measured on a TABWEE W90 and a Redmi Note 13 Pro / HyperOS; see the benchmarks page for the method and scripts.

Do you need Cefrium?

Honest answer: often not — and that is the point. Knowing when you do is what makes it worth the engine it bundles.

Stick with WebView if…

You show a help page, a login, docs or the occasional link — a simple in-app browser. The system WebView adds no ~150 MB engine and is perfectly good. Don't reach for Cefrium for that.

🚀

Reach for Cefrium if…

You render web to a buffer or PDF headlessly, pin the engine for identical rendering everywhere, control the network deeply, or embed web inside your own rendering — or you already have a CEF desktop app and want Android with the same API.

Get started

// Surface mode — video, audio, GPU compositing
CefriumBrowser browser = CefriumBrowser.createWithSurface(activity);

browser.setOnUrlChangedListener(url -> urlBar.setText(url));
browser.setOnTitleChangedListener(title -> setTitle(title));
browser.setOnLoadingStateChangedListener((loading, back, fwd) ->
        progressBar.setVisibility(loading ? VISIBLE : GONE));

browser.loadUrl("https://example.com");

// OSR mode — headless, screenshots, PDF
CefriumBrowser headless = new CefriumBrowser(1080, 1920, density);
headless.setRenderHandler((w, h, pixels) -> { /* pixel buffer */ });
headless.loadUrl("https://example.com");

See it in action

A car infotainment demo on a real device: the real SomaFM radio keeps playing while you use the real OpenStreetMap map — two live Chromium engines at once.

Sound on — the music is the point

The System WebView can't do this with the real sites: one view tears down the radio when you navigate, and somafm.com / openstreetmap.org refuse to be iframed — so keeping both live at once takes two engines. Why this matters →

Built on 18 years of CEF

🏆

CEF powers the best

Steam, Spotify, Discord, OBS — over 100 million installed instances use CEF on desktop. Cefrium brings the same framework to Android.

🛠

Production engineering

Tracks Chromium security releases for CVE patches. Official build with LTO optimization. Tested on real devices across manufacturers.

🔍

Fully auditable

24 source files, 3600 lines of platform code, 28 Chromium patches (~450 lines of changes). Every change is reviewable with git diff. No black boxes.

About

Cefrium is in early validation. The project tracks Debian Chromium releases for CVE patches (currently 149.0.7827.102). Tested on real devices (Xiaomi, Tabwee). Published as LGPL-3.0 for the community to evaluate, use, and extend.

If you work with CEF, Chromium internals, or native Android development and are interested in co-maintaining, get in touch.

cefrium@proton.me