Native Features app template
Every FreeApp API: vibrate, torch, notify, share, battery, TTS and more.
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.
Short native toast.
One-shot buzz (default 50 ms) or an [off, on, off, onโฆ] pattern.
Android share sheet.
Copy to clipboard.
Flashlight, returns false if no flash.
Keep the screen on.
0.0 to 1.0 for this window, negative restores system brightness.
E.g. '#2563EB'.
Hide system bars (immersive).
Instant local notification (asks permission on Android 13+).
Native text-to-speech, lang like 'en-US'.
Print / save the page as PDF.
FreeApp.store.set() FreeApp.store.get()
Persistent native key/value (JSON).
Saves to Downloads; FreeApp.on('saved', d => โฆ) gives {name, ok, location}.
Open this app's system settings page.
How the template calls them
if (window.FreeApp) {
FreeApp.toast('Battery: ' + FreeApp.battery().level + '%');
FreeApp.vibrate([0, 80, 60, 80]);
FreeApp.torch(true);
FreeApp.speak('Hello from Free HTML to APK');
FreeApp.notify('Demo', 'Native notification');
}
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: Native Features โ a showcase grid of buttons that each demonstrate one native feature. Every FreeApp API: vibrate, torch, notify, share, battery, TTS and more.
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.toast(message: string): void โ short native toast
- FreeApp.vibrate(ms?: number | number[]): void โ one-shot buzz (default 50 ms) or an [off, on, off, onโฆ] pattern
- FreeApp.share(text: string, title?: string): void โ Android share sheet
- FreeApp.copy(text: string): void โ copy to clipboard
- FreeApp.device(): {manufacturer, model, brand, androidVersion, sdkInt, language, screenWidth, screenHeight, density, isTablet, darkMode}
- FreeApp.app(): {packageName, versionName, versionCode, name, firstInstall}
- FreeApp.battery(): {level: number /* 0-100 */, charging: boolean}
- FreeApp.online(): boolean
- FreeApp.network(): 'wifi' | 'cellular' | 'ethernet' | 'vpn' | 'other' | 'none' | 'unknown'
- FreeApp.torch(on: boolean): boolean โ flashlight, returns false if no flash
- FreeApp.keepAwake(on: boolean): void โ keep the screen on
- FreeApp.brightness(level: number): void โ 0.0โ1.0 for this window, negative restores system brightness
- FreeApp.statusBar(hexColor: string): void โ e.g. '#2563EB'
- FreeApp.fullscreen(on: boolean): void โ hide system bars (immersive)
- FreeApp.orientation(value: 'portrait' | 'landscape' | 'sensor_portrait' | 'sensor_landscape' | 'sensor' | 'unspecified'): void
- FreeApp.notify(title: string, body?: string): void โ instant local notification (asks permission on Android 13+)
- FreeApp.speak(text: string, lang?: string): void โ native text-to-speech, lang like 'en-US'
- FreeApp.print(): void โ print / save the page as PDF
- FreeApp.store.set(key: string, value: any): void โ persistent native key/value (JSON)
- FreeApp.store.get(key: string): any | null
- FreeApp.saveFile(name: string, mime: string, data: string /* base64 or data: URL */ | Blob): Promise<boolean> โ saves to Downloads; FreeApp.on('saved', d => โฆ) gives {name, ok, location}
- FreeApp.requestPermission(name: 'camera' | 'microphone' | 'location' | 'notifications'): Promise<boolean>
- FreeApp.openSettings(): void โ open this app's system settings page
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 Starters templates
Blank App
Clean mobile boilerplate with safe areas, theme color and a FreeApp ready hook.
Full-screen Canvas
Edge-to-edge canvas starter for games: crisp on any screen, touch input, game loop.
Business Card
One-page profile with tap-to-call, email and share.
Ads Demo
Banner, interstitial and rewarded AdMob ads with a coin balance and a live event log.