HTML: structure
Defines the elements on the page: headings, text, images, buttons and forms.
HTML to APK, built in the cloud
A wrapper packages your HTML, CSS and JavaScript into a native Android or iOS app. The phone's built-in web engine draws your pages, so the code you already write for the browser can run inside the app.
Android builds are available now. iOS builds are coming soon.
Your files stay the same. The wrapper adds the app layer around them.
01 What a wrapper is
A wrapper is a small native app project with a WebView inside. The WebView loads index.html from
the app's own files, so the app opens straight to your page. The wrapper also adds what a store app needs: an
icon, a package file that users install, and a store listing.
| Question | Opened in a browser | Wrapped as an app |
|---|---|---|
| Where the code runs | The browser tab's engine | The app's WebView, which uses the phone's built-in engine |
| How people get it | They type or open a URL | They install an APK or AAB, or get it from Google Play |
| Address bar | Shown | Hidden. The app has its own icon and screen. |
| Phone features | Limited to what the browser allows | Available through a JS bridge |
| Updates | Deploy the site, and visitors see the change | Build and publish a new package |
Same code in both columns
Your HTML, CSS and JavaScript do not change between a browser tab and a wrapped app. Only the container around them changes.
02 Your code
A web page is three files with three jobs. The browser reads each file and draws the result. A phone WebView reads them the same way.
Defines the elements on the page: headings, text, images, buttons and forms.
Sets colours, spacing, layout and animation. It also decides how the page fits small and large screens.
Reacts to taps, fetches data and changes what the page shows.
Edit the code and the preview updates as you type. The preview runs in a sandboxed frame in your browser.
03 Runtimes
A phone WebView runs JavaScript the same way a browser does. Node.js and Bun also run JavaScript, but outside the browser. They have no page to draw, so people use them to build and test code before the zip step.
// Runs in any browser tab
document.querySelector('h1').textContent = 'Hello from HTML'
// Run with: bun run build.ts
await Bun.build({
entrypoints: ['src/app.ts'],
outdir: 'www',
})
// Runs in the app's WebView, with the bridge loaded
await WebView.statusBar.setColor('#0f1220')
The build runs on your machine, the phone gets the result
Node.js or Bun can prepare your files before you zip them. The phone receives only the finished HTML, CSS and JavaScript, so the phone never needs Node.js or Bun.
04 Built-in engine
Both systems include a component that shows web content inside an app. A native app can place it on any screen, and it renders HTML, CSS and JavaScript.
Built on Chromium, the same rendering base as Chrome for Android. Google delivers updates through Google Play, separately from the Android version.
Built on WebKit, the engine behind Safari. It ships with iOS, so its updates arrive with iOS updates.
Native controls can share the screen with the web page
A native app can keep its header, tabs or buttons native and give the rest of the screen to a WebView that shows your HTML.
05 JS bridge
A page cannot reach the status bar, device details or the share sheet on its own. A JS bridge passes requests from the page to the native app. The app runs the action and sends an answer back to the page.
import { WebView } from '@yandeu/js-bridge'
const result = await WebView.statusBar.setColor('#0f1220')
if (!result.ok) console.log(result.errorMessage)
import { WebView } from '@yandeu/js-bridge'
const result = await WebView.deviceInfo()
if (result.ok) console.log(result.payload)
{ "ok": false, "errorMessage": "Not running inside Flutter WebView" }
{ "ok": true, "payload": { ... } }
This page runs in a browser, so the call gets an error reply, because no native app answers it. Inside the app,
the same call resolves with ok: true and the result in payload.
How each platform receives the message
Android lets the app give the page a Java or Kotlin object to call. iOS lets the page post a message to a named
handler that the app registers, through window.webkit.messageHandlers. The bridge hides these
differences behind one API.
06 Why wrap
You write the web app once. Each platform gets a package built from the same files, so a fix in your JavaScript reaches every build after you rebuild.
Your HTML, CSS and JavaScript live in one folder. Every package comes from those files.
You do not write Java, Kotlin or Swift. The wrapper contains the native project.
html2app builds the Android package in the cloud. You upload a ZIP and download the APK or AAB.
Trade-offs
07 Get started
Start with a folder that has index.html at its root. Link your CSS, JavaScript and images with
relative paths.
Keep index.html at the root and link files such as ./style.css and ./app.js.
For a folder named www, run zip -r app.zip www.
Upload the ZIP on the home page. Free Android debug APKs are available. Signed APK and AAB builds need a paid plan.
$zip -r app.zip www
# Upload app.zip on html2app.dev and download the APK.
08 FAQ
Short answers about wrappers, packages and the build.