Photo Compressor app template
Pick a photo, shrink it natively with size and quality sliders, then save or share it.
This is the template running live. Phone features such as the camera, vibration and notifications work in the app you build.
Phone features this template uses
These come from the FreeApp JavaScript bridge that every app built with Free HTML to APK includes. In a normal browser the template still runs, and the calls simply do nothing.
Native, fast on low-end phones.
Saves an image to Photos.
Share a real file.
Short native toast.
How the template calls them
const f = await FreeApp.pickFile({ accept: ['image/*'] });
const small = await FreeApp.compressImage(f.dataUrl, { maxSize: 1280, quality: 80 });
console.log(f.size, '->', small.bytes);
Make it yours with AI
Copy this prompt into ChatGPT, Gemini or Claude, change the idea to yours, and paste the answer back into the editor. It already explains the app shell and the phone features to the AI.
Show the AI prompt
Build a single-file mobile web app (index.html with inline CSS/JS) for Android WebView.
The app: Photo Compressor โ a photo compressor that shows the before/after size and saves the smaller image. Pick a photo, shrink it natively with size and quality sliders, then save or share it.
Requirements:
- Mobile-first, touch-friendly UI (min 44px tap targets), works in portrait, supports light and dark mode.
- Use <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> and pad for env(safe-area-inset-*).
- Must work fully offline: no CDN or external scripts, fonts or images; persist data in localStorage.
The page runs inside an Android app that injects a native bridge as window.FreeApp. Available APIs:
- FreeApp.pickFile(opts?: {accept?: string[], multiple?: boolean}): Promise<{name, mime, size, dataUrl}>
- FreeApp.compressImage(dataUrl: string, opts?: {maxSize?: number, quality?: number}): Promise<{dataUrl, width, height, bytes}> โ native, fast on low-end phones
- FreeApp.saveToGallery(dataUrl: string, fileName?: string): Promise<{uri}> โ saves an image to Photos
- FreeApp.shareFile(fileName: string, mimeType: string, base64OrDataUrl?: string): boolean โ share a real file (omit the data to share an app file by name)
- FreeApp.toast(message: string): void โ short native toast
Rules for the bridge:
- Always guard calls with `window.FreeApp &&` (or `if (window.FreeApp) { โฆ }`) and provide a browser fallback so the page also works in a normal browser.
- The bridge may be injected after your script runs: do native setup inside `window.addEventListener('freeappready', โฆ)` and also run it immediately if window.FreeApp already exists.
- Do not use alert/confirm for normal feedback; prefer FreeApp.toast when available.
Return the complete index.html in one code block.
My idea: [DESCRIBE YOUR APP IDEA HERE]Turn it into an Android app
- Tap Edit & build online. The template opens in the online editor.
- Change the text, colors and code, then pick an app name, an icon and a package name.
- Build. You get a signed APK to install and an AAB for Google Play, free, with no account and no watermark.
More Media templates
Text to Speech
Read any text aloud with language, rate and pitch.
Voice Notes
Dictate notes with speech recognition and save them.
Camera
Live camera preview, filters, snapshots and save to device.
Voice Recorder
Record audio with level meter, playback and save.
QR Generator
Make QR codes offline for text, links and Wi-Fi; save PNG.
Drawing Pad
Finger painting with colors, brush sizes, undo and save PNG.