Prompt file imported from ZACK770/studytoy (
.windsurf/workflows/android-app.md). Copyright stays with the author.
Android App Workflow (Capacitor)
Prerequisites
- Android Studio installed (https://developer.android.com/studio)
- Java 17+ (comes with Android Studio)
- USB Debugging enabled on your Android device (or use emulator)
Daily Workflow — Update App After Code Changes
Every time you change frontend code and want to update the Android app:
cd frontend
npm run android:sync
This single command does:
tsc— type checkvite build— builds todist/cap sync android— copiesdist/into the Android project + updates plugins
Then open in Android Studio:
npm run android:open
Or run directly on a connected device:
npm run android:run
First Time Setup (Already Done)
These steps are already completed:
npm install @capacitor/core @capacitor/cli @capacitor/android @capacitor/camera @capacitor/filesystem- Created
capacitor.config.tswith appIdapp.learnplay.android npx cap add android— generatedandroid/folder- Added camera permissions to
AndroidManifest.xml npx cap sync android— synced web assets
Building APK / AAB for Google Play
- Open Android Studio:
npm run android:open - In Android Studio: Build → Generate Signed Bundle / APK
- Choose Android App Bundle (AAB) for Play Store upload
- Create a keystore (first time only) — KEEP THIS SAFE, you need it for every update
- Build the release AAB
- Upload to Google Play Console (https://play.google.com/console)
Publishing to Google Play
- Create a Google Play Developer account ($25 one-time fee): https://play.google.com/console/signup
- Create a new app in the console
- Fill in: app name, description, screenshots, icon, privacy policy
- Upload the AAB from step above
- Submit for review (takes 1-7 days first time, then hours for updates)
App Icon & Splash Screen
- Replace icon files in
android/app/src/main/res/mipmap-*/ - For splash screen, use
@capacitor/splash-screenplugin
Key Files
frontend/capacitor.config.ts— Capacitor configurationfrontend/android/— Full Android project (open with Android Studio)frontend/android/app/src/main/AndroidManifest.xml— Android permissionsfrontend/src/utils/capacitor.ts— Native camera/gallery utilitiesfrontend/src/components/NativeFilePicker.tsx— Reusable native file picker component
Important Notes
- The
android/folder IS part of the repo (it contains custom permissions & config) - Never manually edit files inside
android/app/src/main/assets/— those are auto-generated bycap sync - Backend URL: The app points to your production backend. For local dev, edit
capacitor.config.ts→server.url
