In Gemini Canvas, open the code view, copy or download the HTML, save it as index.html, and build it with HTML to APK. If the Canvas app calls Gemini's API at runtime, it will need its own API key and internet to work outside Canvas.
- Best mode
- HTML to APK
- Needs
- The HTML from Canvas
- AI features inside
- Need your own API key
- Offline
- Yes, if no API calls
Steps
- Switch to codeIn Canvas use the code toggle to see the HTML.
- Copy or downloadSave it on your phone as
index.html. - Remove Canvas-only bitsAnything that depends on the Canvas preview environment — e.g. AI calls through Canvas — won't run outside it.
- Build the APKHTML to APK → pick the file → name and icon → build.
Apps that call an AI model
Some Canvas creations ask Gemini for answers while you use them. Outside Canvas, that call needs an API key. Putting a secret key inside an APK is risky — anyone can unpack the file and read it. The safe pattern is a small server (or serverless function) that holds the key and that your app calls. For a simple personal tool, ask Gemini to rewrite the app so it works without AI calls.
Good Canvas-to-app candidates
- Flashcards and quizzes
- Unit converters and calculators
- Simple games (canvas-based)
- Checklists and trackers using localStorage
Testing the app after you build it
| Check | Why |
|---|---|
| Open it in airplane mode | Proves nothing still loads from the internet |
| Close and reopen it | Proves data saved with localStorage survives |
| Rotate the phone | Canvas games often need a fixed orientation — set it in the maker |
| Tap with a thumb, not a stylus | Small buttons that worked in the Canvas preview may be too tight |
| Use the system Back button | It should go back a screen, not exit unexpectedly |
Iterating with Gemini
Describe problems to Gemini in phone terms: "On a 360 px wide Android screen the buttons overlap" or "Back button should close the settings panel". Then replace your index.html, rebuild with a higher version number, and install over the old app — your saved data stays.
Questions people ask
Do Gemini Canvas apps work offline as APKs?
Yes, unless they call an online API.