Skip to main content

Bundle HTML/CSS/JS into an Android WebView app

Project description

20260310-2134-Image-Generation-simple-compose-01kkckwg2fe99angdtynps6sv9.png

🍬 Bonboneka (bomk)

Bonboneka allows you to bundle your HTML, CSS, and JS assets into a native Android WebView app with a single command(yea its that cool). Why did i do this? Because its REALLY hard to convert a website into an (android) app, and i wanted to make it easier for everyone.(yeah its really straightforward), JUST 1 COMMAND.

Features

  • Automatic Inlining: Converts external CSS and JS into a single, self-contained HTML file.
  • Asset Encoding: Automatically converts images into Base64 data URIs.
  • Multi-Bundle Support: Define multiple entry points and bundles using a simple naming convention.

Requirements

  • Python: 3.10+
  • Git(of course you need git)
  • Android SDK + Java: Necessary for...I don't know, BUILDING THE APP?!

🛠 Installation

There are 2 ways to install:

    1. [RECOMANDED] Running pip install bonboneka, as it's avabile on PiPy
    1. Dowloading the latest release and running pip install -e .

Usage

bomk create <path/to/folder> [options]

Options

  • /s Silent mode: Suppress all terminal output.
  • /verbose Verbose mode: Show detailed build logs.
  • -o <dir> Output: Specify the directory for the generated APK.
  • --icon <path> Icon: Set a custom icon for the app.

File Naming Convention

To define which bundle a file belongs to, tag the filename with _$ before the extension.

Example Structure:

my_app/
├── index_$1.html          ← Main entry point (Group 1)
├── styles_$1.css          ← Styles for Group 1
├── script_$1.js           ← Logic for Group 1
├── start_$2.html          ← Secondary page (Group 2)
├── styleofstart_$2.css    ← Styles for Group 2
└── backend_$2.js          ← Logic for Group 2

NOTE!

Group $1 is always treated as the app's primary entry point. All assets in a group are bundled into one self-contained HTML file.

⚙️ Configuration

Customize your build environment by editing bomk/config.py:

# The repository used as the Android project scaffold
TEMPLATE_REPO      = "https://github.com/YourUser/Example-Android-WV-App.git"
# Relative paths within the template
ASSETS_REL_PATH    = "app/src/main/assets"
MAIN_JAVA_REL_PATH = "app/src/main/java/exampleWV/app/Main.java"

🌐 Encased Mode

Bonboneka can create a wrapper for an website

bomk create --encased <url> [options]

Example:

bomk create --encased https://example.com -o ./dist /verbose

Bonboneka will:

  • Generate an html file
  • Take the url
  • Add an iframe
  • Add the website to the iframe
  • Generate a WebView Android project
  • Build the APK automatically

bomk doctor - Troubleshooting advisor

The bomk doctor command will troubleshoot any valid Bonboneka projects. Usage:

bomk doctor <path-to-project>

This command will check for common issues such as:

  • Missing or misnamed files
  • Incorrect file naming conventions
  • etc etc.

[BETA] Gitlink

Gitlink is a feature that lets you link a template to an existing GitHub repo. In other words overiding the default template's github remote with your own. By using the --behaviour flag, you can specify if you want to commit automaticly(per build) or if you want to commit manualy (bomk gitlink --commit). List of comands:

  • bomk gitlink --behaviour <commit-per-build/manual-commit>
  • bomk gitlink --url/--set <url>
  • bomk gitlink --commit/--push(or you can put both)

To note: Gitlink is in BETA and has not undergone rigorous testing, it might break/not work.

Version: .

  • Github: 0.1.6 "Antoneta" cli.py version patch, Toml and README Patch.
  • PiPy package version: 0.1.6 "Antoneta" cli.py version patch, Toml and README Patch.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bonboneka-0.1.65.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bonboneka-0.1.65-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file bonboneka-0.1.65.tar.gz.

File metadata

  • Download URL: bonboneka-0.1.65.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for bonboneka-0.1.65.tar.gz
Algorithm Hash digest
SHA256 0c523bd5a27ab5e59c090a7809bde17327d051e1706a8182d3441c5a3fc835c7
MD5 4bc7db43430a3a2ba5e971189900b8d2
BLAKE2b-256 c3ac065ca8d5dd7f83d3a5b273174ccc347dadf360c309cf786e164051f08e88

See more details on using hashes here.

File details

Details for the file bonboneka-0.1.65-py3-none-any.whl.

File metadata

  • Download URL: bonboneka-0.1.65-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for bonboneka-0.1.65-py3-none-any.whl
Algorithm Hash digest
SHA256 4d8eca77216a54932c693afc3fe8d845c58653169f9322ce111ab9b4111bf32c
MD5 50b1ddc9586c20a8137b542524c77df9
BLAKE2b-256 0630d474e62f1aafe33fd1a832e2cb2129ffc8c9fcd4d953b97d348eba4acf23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page