WebviewJS on Android is an experimental platform target that embeds a nativeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/webviewjs/webview/llms.txt
Use this file to discover all available pages before exploring further.
WebView inside an Android Activity using Tao’s Android backend. It supports both 64-bit ARM (aarch64) and 32-bit ARM (armv7) devices, making it compatible with the vast majority of Android hardware. The API surface is intentionally minimal — most windowing primitives do not apply to Android, and the two Android-specific methods (androidContentRect() and androidConfig()) give you the information you need to integrate the webview with the rest of your native UI.
Supported Architectures
WebviewJS targets the two most common Android CPU architectures:| Architecture | Android target triple |
|---|---|
| ARM64 (64-bit) | aarch64-linux-android |
| ARMv7 (32-bit) | armv7-linux-androideabi |
x86 and x86_64 Android targets (used in the emulator) are not currently supported. Use a physical ARM device or an ARM-capable emulator (e.g. Apple Silicon Mac’s Android emulator with ARM images).
Android-Specific Runtime APIs
androidContentRect()
androidContentRect() returns the current native content inset rectangle — the area within the Activity window that the WebView occupies, in pixels relative to the Activity’s top-left corner. This is useful for laying out additional native views (e.g. a bottom navigation bar) alongside the webview:
AndroidContentRect:
androidConfig()
androidConfig() returns the current Android configuration as a diagnostic string. This is intended for debugging and logging — for example, to record device locale, screen density, and orientation at crash time:
androidConfig() is a diagnostic utility and should not be used to make layout decisions. Use androidContentRect() for layout, and standard web APIs (screen.width, window.devicePixelRatio, etc.) for responsive design.Unsupported APIs on Android
Some WebviewJS features are not available on Android and will throw an error or silently no-op:System tray
System tray
app.createTrayIcon() returns an error on Android — the Android platform has no system tray concept. Guard tray creation with a platform check if your code targets multiple platforms.Native file dialogs
Native file dialogs
win.openFileDialog() is not implemented on Android. Use the Web File API (<input type="file">) or a custom protocol handler to access the filesystem.Menu bars
Menu bars
Configuration Tips
Use logical pixels for layout
Android devices vary widely in pixel density. Always pass
logical: true to setSize() and setPosition(), or set logical: true in BrowserWindowOptions, so your layout uses density-independent pixels.Load content via a custom protocol
Android’s WebView has restrictions on
file: access to app-internal assets. Register a custom protocol via win._registerProtocol() to serve your HTML, CSS, and JS, then load from it:Known Limitations
win.setProgressBar()is not implemented on Android.win.setContentProtection()behaviour depends on the OEM’s WebView implementation.win.setSkipTaskbar()is a no-op (Android has no taskbar).- Window transparency (
transparent: true) requires the Activity to be configured with a transparent theme in the Android manifest; WebviewJS cannot set this at runtime.