Cefrium — CEF for Android

Chromium Embedded Framework on native Android. Video, audio, ad blocking, off-screen rendering. Full browser engine control beyond WebView.

Source Code Samples

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. What WebView can't do.

📱

Two Rendering Modes

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

📦

SDK AAR

Standard Gradle integration. Add the dependency, call initialize(), load a URL. 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 WebView

CapabilityCefriumWebView
Request interceptionCefRequestHandler (full control)shouldInterceptRequest (limited)
Off-screen rendering (pixel buffer)OnPaint APINo
Chromium version controlPinned (currently 148)Varies by device
Multi-process controlYesNo
Custom protocol handlersCefSchemeHandlerFactoryVia shouldInterceptRequest
Modern CSS (scroll-driven, view transitions)Always (Latest Chromium)Depends on device WebView version
Download interceptionCefDownloadHandlerDownloadListener
Context menu customizationCefContextMenuHandlerLimited

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");

About

Built by Juan Manuel Mendez Rey — Debian CEF packager (six architectures, 2000+ validation builds). The Android port applies the same engineering rigor to a platform CEF hasn't supported before.

cefrium@proton.me