A minimal Android WebView wrapper kit for building native Android apps with plain HTML, CSS, and JavaScript.
No React. No Electron. No Capacitor. No bloat. Just a clean, well-documented Android shell that loads your web app and gives it access to native device features through a simple JS bridge.
Built for developers who know the web and want a clean path to shipping an Android app β without dragging in a full cross-platform framework.
WebShell is a template + library + guide for building Android apps where:
- Your UI and logic live in HTML/CSS/JS (inside
assets/www/) - An Android
WebViewhosts the web app full-screen - A JS β Native bridge lets your web code call Android APIs
- The Android shell is tiny β just two Kotlin (or Java) files
Think of it like Capacitor or Cordova, but stripped down to only what you actually need, with zero magic.
| Item | Version |
|---|---|
| Java | 17 (required for AGP 8.7.3) |
Android minSdk |
26 (Android 8.0) |
Android targetSdk |
35 |
| Android Studio | Hedgehog or newer |
| Language | Kotlin or Java (both supported) |
| Build system | Gradle with Kotlin DSL (.kts) |
git clone https://github.com/s17labs/webshell.git MyApp
cd MyApp| File | What to change |
|---|---|
app/build.gradle.kts |
Set applicationId, versionCode, versionName |
app/src/main/AndroidManifest.xml |
Set app name, icon, permissions |
app/src/main/res/values/strings.xml |
Set app display name |
Full details in Getting Started β
Put your HTML/CSS/JS files in:
app/src/main/assets/www/
Include bridge.js in your HTML and you're connected to native.
./gradlew assembleDebugThe APK will be at app/build/outputs/apk/debug/app-debug.apk. Install it on your device or emulator.
webshell/
βββ README.md β You are here
βββ docs/
β βββ getting-started.md β Setup walkthrough
β βββ project-structure.md β Where everything lives
β βββ bridge-api.md β Full JS β Native bridge docs
β βββ gotchas-and-tips.md β Important warnings & edge cases
β βββ examples.md β Code examples
β βββ java-reference.md β Java equivalents for all Kotlin source files
βββ app/ β The Android app module
β βββ build.gradle.kts
β βββ src/main/
β βββ AndroidManifest.xml
β βββ assets/www/ β YOUR WEB APP GOES HERE
β β βββ index.html
β β βββ bridge.js β The JS-side bridge (include this)
β β βββ app.js β Starter app (replace with yours)
β β βββ style.css β Starter styles (replace with yours)
β βββ kotlin/com/yourapp/
β β βββ MainActivity.kt
β β βββ NativeBridge.kt
β βββ res/
βββ build.gradle.kts
βββ gradle.properties
βββ gradle/wrapper/ β Gradle wrapper files
β βββ gradle-wrapper.jar
β βββ gradle-wrapper.properties
βββ settings.gradle.kts
βββ gradlew β Build script (run with: ./gradlew assembleDebug)
Your JS Android (Kotlin/Java)
ββββββ βββββββββββββββββββββ
window.Native.showToast() β NativeBridge.showToast()
window.Native.getInfo() β NativeBridge.getInfo() β returns JSON string
NativeBridge.on('event') β webView.evaluateJavascript(...)
bridge.js wraps window.Native with safe fallbacks so your app also runs in a desktop browser for development. Full docs in Bridge API β
- Getting Started β step-by-step setup from scratch
- Project Structure β what lives where and why
- Bridge API β full reference for JS β Native communication
- Gotchas & Tips β threading, back button, storage, security, and more
- Examples β real usage patterns
- Java Reference β Java equivalents for all Kotlin source files
- Full-screen WebView shell (Kotlin + Java versions)
- JS β Native bridge with thread safety handling
bridge.jsβ browser-safe wrapper for the native interface- Back button handling (WebView history navigation)
localStorage/sessionStoragesupport- Hardware acceleration enabled
- Edge-to-edge / immersive display support
- Starter HTML/CSS/JS app in
assets/www/ - Complete documentation
- Camera/microphone access (requires runtime permissions β see Gotchas)
- Push notifications
- File system access beyond assets
- Auto-update mechanism
- Any JS framework β bring your own (or none)
WebShell exists because most cross-platform tools solve problems you don't have while adding problems you didn't want. If you just need an Android app that renders your web UI and can call a few native APIs, you don't need Capacitor or Cordova. You need a WebView and a bridge.
This kit keeps the Android side as thin and readable as possible so you always understand exactly what's happening. There's no CLI, no plugin system, no config format to learn. It's just Android code that you own and can change.
MIT β use it, fork it, ship with it.