Skip to content

ASTRALLIBERTAD/web-app

Repository files navigation

Android WebView App Template

A minimal Android app template that wraps any HTML/CSS/JS project into a native Android application using a WebView. No complex Android development required — just drop in your web files and build.


How It Works

The app launches a fullscreen WebView that loads a local HTML file bundled with the APK. Your entire frontend (HTML, CSS, JavaScript) lives in the assets folder and runs inside the WebView as if it were a browser.


Project Structure

app/
└── src/
    └── main/
        ├── assets/
        │   └── snoop/               ← PUT YOUR WEB FILES HERE
        │       └── main.html        ← Entry point (loaded on launch)
        ├── java/.../MainActivity.kt ← WebView setup (no need to touch)
        └── res/
            └── values/
                └── strings.xml      ← Change app name here

Getting Started

1. Add Your Web Files

Place your HTML, CSS, and JS files inside:

app/src/main/assets/snoop/

Make sure your entry point is named main.html. All relative paths (CSS, JS, images) work as normal.

2. Change the App Name

Edit app/src/main/res/values/strings.xml:

<string name="app_name">Your App Name</string>

3. Build & Run

Open the project in Android Studio, connect a device or start an emulator, and hit Run.


Configuration

Key WebView settings in MainActivity.kt:

Setting Value Description
javaScriptEnabled true Enables JS execution
mediaPlaybackRequiresUserGesture false Allows autoplay audio/video
Entry URL file:///android_asset/snoop/main.html Change folder/file name here if needed

To change the assets subfolder or entry file, update this line in MainActivity.kt:

webview.loadUrl("file:///android_asset/YOUR_FOLDER/YOUR_FILE.html")

Requirements

  • Android Studio (Hedgehog or newer recommended)
  • Min SDK: as configured in build.gradle
  • No internet permission required (loads local files only)

Notes

  • The app uses a NoActionBar theme for a clean fullscreen experience.
  • The onDestroy, onPause, and onResume WebView lifecycle methods are included but commented out — uncomment them for better memory management in production.
  • This template does not use Jetpack Compose for the main UI — the WebView is set directly as the content view.

About

A minimal Android template that wraps any HTML/CSS/JS project into a native app using WebView — no Kotlin UI code needed, just drop in your web files and build.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors