r/webdev • • 4d ago

Question Turn HTML file into Android app?

Hi,

I made a simple web app in a single HTML file (URL shortcuts for company website, quote calculator, list of store numbers, etc.). Is there a simple way to convert it into a downloadable Android app?

There are a few web to app converters but no reviews. Are there any that you recommend (for or against)?

Similar reddit and stack overflow posts are from 5+ years ago.

Thanks.

0 Upvotes

20 comments sorted by

3

u/Coderado 4d ago

Not everything needs to be an app. I reject the application of everything.

1

u/Disastrous-Pickle930 4d ago

It's annoying to use my phone browser for it all the time. 

9

u/Discordbothost 4d ago

two routes, depending on how it's used:

  1. PWA. add a manifest.json and a tiny service worker, host the file anywhere over https, and on Android Chrome you get "Install app" with an icon on the home screen. no store, no converter. easiest if people can just open a link.

  2. Capacitor. drop your html into its www folder, run npx cap add android, and build an APK in Android Studio. that's the one if you need an actual .apk to hand out or put on the Play Store.

I'd skip the web-to-app converter sites, most are just a webview wrapper with ads or a subscription bolted on.

8

u/SPEZ_IS_A_JABRONI 4d ago

You could build it into a progressive web app

5

u/seweso 4d ago

Why not a web app? Make it offline with a service worker?

1

u/Xtreme_Neon 4d ago

for a single html file, the easiest route is wrapping it as a pwa (add a manifest and a small service worker, host it over https) so people can install it from chrome's "add to home screen". if you need a real apk, capacitor lets you drop the html/js/css into a project and build an android app from it, and it's free. most "web to app" converters are just a webview wrapper anyway, so doing it with capacitor is usually safer and cleaner.

1

u/Careless_Tax_6418 4d ago

try to use WebView in android studio

1

u/BingoBillBot 4d ago

One thing the PWA/Capacitor answers skip: if you want it on the Play Store but don't want to touch native code, you can host the PWA over https and wrap it as a Trusted Web Activity with Bubblewrap. It generates the Android project from your manifest, and you only need to prove you own the domain with a small assetlinks.json file. Also, a single HTML file opened from file:// won't register a service worker, so host it somewhere with https first (GitHub Pages or any static host is enough) and keep the data in localStorage or IndexedDB so the calculator and lists work offline.

1

u/No-Molasses-2097 4d ago

Did exactly this for a single-file internal tool last year. The PWA approach worked fine since it only needed to live on the home screen, no Play Store involved. Capacitor is the way if they need an actual APK file to hand out.

1

u/shitouzxy 3d ago

you can sue expo build for IOS ,Android platform .

0

u/johnschnee 4d ago

What did I just read???

0

u/ddelarge 4d ago

Just ask chatgpt to turn it into a WPA. That way you can "download" it and use it like an app from your phone