๐งฉ HBH-WEB2APP โ Convert Any Website / HTML Folder Into Android APK
HBH-WEB2APP is a Node.js-based Android APK generator that converts any website, local folder, or zip archive into a full Android application โ automatically.
โ No Android Studio โ No Gradle knowledge โ Runs on Windows, macOS, Linux โ Full offline build system โ Auto-installs Java + Android SDK โ Custom App Name, Package Name, Icons
๐ Features
- ๐งฑ Generate APK from URL, HTML folder, or ZIP
- ๐จ Auto-generate adaptive Android icons (sharp)
- ๐ Full Gradle Build System
- ๐ Automatic Android SDK + Java 17 installer
- ๐ Full asset pipeline
- ๐ Template-based build workflow
- ๐ฆ Batch build support
- โฑ Execution time tracker
- ๐งน Safe template extraction system
๐ฆ Installation
1npm install hbh-web2app
Or globally:
1npm install -g hbh-web2app
๐ Setup Android Build Environment
Before building an APK, run:
โ Check SDK & Java
1npm run check-sdk
or
โ Check SDK & Java (manually)
1const { CheckSDK } = require("hbh-web2app");3async function verifySDK() {4 const result = await CheckSDK();5 console.log(result);6}8verifySDK();
This function will check if your system already has the required:
- OpenJDK 17
- Android SDK command-line tools
- Platform-tools and Build-tools
- Required Android platform
โ Install Android SDK + Java (portable โ inside your project)
1npm run install-sdk
or
โ Install Android SDK + Java manually
1const { InstallSDK } = require("hbh-web2app");3async function setupSDK() {4 await InstallSDK(/*SDK_PATH: optional*/);5 console.log("SDK + Java installed locally!");6}8setupSDK();
This installs:
- OpenJDK 17
- Android command-line tools
- Platform-tools
- Build-tools 34.0.0
- Android platform 34
It also automatically sets required environment variables.
๐งช Example Usage
1const { GenerateApp } = require("hbh-web2app");3GenerateApp({4 appName: "HBHGoogle",5 packageName: "hbh.sites.google",6 asset: "https://www.google.com/", // URL OR Folder OR Zip7 appIcon: "https://www.google.com/favicon.ico" // URL OR local_path8});
1GenerateApp({2 appName: "LocalSite",3 packageName: "com.local.site",4 asset: "./my-website-folder"5});
1GenerateApp({2 appName: "ZippedWebsite",3 packageName: "com.zip.site",4 asset: "./site.zip"5});
1const { GenerateApps } = require("hbh-web2app");3GenerateApps([4 {5 appName: "AppOne",6 packageName: "com.app.one",7 asset: "https://google.com"8 },9 {10 appName: "AppTwo",11 packageName: "com.app.two",12 asset: "./localfolder"13 }14]);
๐ Output
APK files are generated here:
/output/<AppName>/<AppName>.apk
Example:
output/MyWebApp/MyWebApp.apk
๐งฌ Project Structure (Internal Overview)
app/
โโ builder.js # Main build system
โโ helpers/ # logger, unzip, icon generator, etc.
โโ tasks/ # assets, build, applyConfig, etc.
โโ utils/ # TrackTimeWrapper
โโ setupWorkflow.js # safe extraction + cleanup
โโ config.js
checking.js # SDK checker
installer.js # SDK & Java installer
index.js # Main exports
โ API โ Configuration Options
| Option | Type | Description |
|---|---|---|
appName |
string | Android app name |
packageName |
string | e.g. com.example.app |
asset |
string | URL, folder, or zip path |
appIcon |
string | PNG/JPEG/WebP image |
๐จ Icons
App icons are auto-generated into:
mipmap-mdpi
mipmap-hdpi
mipmap-xhdpi
mipmap-xxhdpi
mipmap-xxxhdpi
Each converted to:
ic_launcher_foreground.webp
๐ง Built-In Commands
| Command | Description |
|---|---|
npm run check-sdk |
Check Java + Android SDK |
npm run install-sdk |
Install SDK + Java locally |
๐งโ๐ป Requirements
- Node.js >= 16
- Windows / macOS / Linux
- 4GB free space for SDK install
- Internet (if using URL or installer)
๐ฌ Author
HBH Creator of HBH-WEB2APP
๐ License
ISC License