1. Home
  2. Use cases
  3. HTML5 game to APK

Use case

How to convert an HTML5 game into an Android APK

Most 2D game engines can export to HTML5 — and an HTML5 export is all you need for an Android game. Zip the export, build it as an offline app, and players get your game with an icon and no browser bar.

Updated 3 min readBy the APK Maker team
Short answerExport your game for the web (HTML5), check that index.html runs from a local folder, zip the export so index.html is at the top level, and build it with an HTML/ZIP to APK builder. The game is bundled inside the APK and plays offline. Keep the export under 5 MB for a free build or 18 MB with Pro.

Engine-by-engine export notes

EngineExportNotes for an APK
Phaser / PixiJS / plain JSYour build folderIdeal: small, fast, fully offline.
Construct 3Web (HTML5)Works well; disable the "offline/PWA" install prompt you don't need in an app.
GDevelopWeb (upload to your own host / local folder)Use the folder export, not the online share link.
Godot 4WebUse the single-threaded export option (Godot 4.3+); threaded builds need cross-origin isolation that app web views may not provide. Godot web exports are large — check the size.
Unity WebGLWebGL buildUsually too big for a bundle limit and heavy on phones; a native Unity Android build is the better route.

Touch, audio and screen

  • Touch input: use pointer or touch events, not mouse-only events. Add touch-action: none on the canvas so swipes don't scroll the page.
  • Audio: like mobile browsers, Android web views start audio only after a user gesture. Show a "Tap to play" screen and start or resume the audio context on that tap.
  • Orientation: design for portrait, or show a "rotate your phone" overlay in portrait if the game is landscape-only.
  • Safe areas: add viewport-fit=cover to the viewport tag and pad HUD elements with env(safe-area-inset-*) so they don't hide under notches.
  • Back button: pressing Back navigates back in the app's history. Keep the game on one page (or use hash routes) so Back doesn't jump out mid-level.

Saving progress

localStorage and IndexedDB work inside the app and persist between launches, so high scores and save games survive closing the app. They are cleared if the user clears the app's data or uninstalls it.

Keeping the build small

  • Convert music to OGG or MP3 at 96–128 kbps; WAV files are the biggest waste.
  • Pack sprites into atlases and compress PNGs, or use WebP.
  • Remove unused engine plugins and debug builds.
  • Free builds take up to 5 MB of bundled files; Pro up to 18 MB.

When it is ready, build with HTML & ZIP to APK, then share it with a download page or publish on Google Play with a Pro AAB.

Make your APK now — free

No Android Studio, no code, no watermark. Pick what you are starting from:

Frequently asked questions

Can I turn a Phaser game into an APK?

Yes. Zip the built game folder with index.html at the top level and build it with an HTML/ZIP to APK builder. It runs offline.

Why is there no sound in my game app?

Android web views block audio until the player taps. Start or resume your audio on the first tap, behind a 'Tap to play' screen.

Will high scores be saved?

Yes. localStorage and IndexedDB persist inside the app between launches.

Can I export a Unity game this way?

Unity WebGL builds are usually too large and slow for this. Use Unity's native Android build instead.