- resources/: 1024 icon.png + 2732 splash.png/splash-dark.png generated from the PWA icon + brand blue; wired @capacitor/assets (npm run assets) + splash-screen plugin. - ANDROID_SETUP.md: end-to-end guide (SDK setup, cap add android, manifest permissions, Firebase/google-services.json + Gradle, run, Play AAB build) for package com.bizgaze.connect. - android-permissions.xml: paste-ready POST_NOTIFICATIONS + camera/mic/WebRTC perms. - mobile/README links the guide; setup adds `npm run assets`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5.2 KiB
Biz Connect — Android build & push setup
Step-by-step to go from this repo to a running Android app with working FCM push. You have Android Studio (Quail 2026.1.1) installed — that bundles the Android SDK and a JDK, so no separate Java install is needed.
The app is a Capacitor shell that loads the live Connect UI (
server.urlincapacitor.config.json, defaulthttps://remote.bizgaze.com). The native side only adds push, camera/mic, status bar, and store packaging. App id / Android package:com.bizgaze.connect— this must match the Firebase app you create below.
1. One-time Android Studio setup
- Launch Android Studio once and let it finish "SDK Components Setup" (downloads the Android SDK + platform-tools).
- More Actions → SDK Manager → install Android SDK Platform 34 (or latest) and Android SDK Build-Tools.
- To test on an emulator: More Actions → Virtual Device Manager → create a Pixel device (any recent API ≥ 33 so you can test the notification permission prompt). Or enable USB debugging on a physical phone and plug it in.
2. Generate the native Android project
cd mobile
npm install
npm run assets # builds icons/splash from resources/ (already provided)
npx cap add android # creates mobile/android/ (gitignored)
npx cap sync # copies config + web assets + plugins into the project
3. App permissions
Capacitor adds INTERNET automatically. Add the rest to
mobile/android/app/src/main/AndroidManifest.xml (inside <manifest>, above <application>).
A ready-to-paste copy is in android-permissions.xml:
<!-- Push (Android 13+ runtime prompt) -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- Voice / video calls + camera from the web UI -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
WebRTC in the WebView: Capacitor grants
getUserMediato the page when the app holds the CAMERA/RECORD_AUDIO permissions, so the existing call/screen-share UI works once these are present and the user accepts the runtime prompts.
4. Firebase / FCM (push)
- Firebase console → Add project (or reuse one).
- Add app → Android. Package name:
com.bizgaze.connect. Register. - Download
google-services.json→ place it inmobile/android/app/. - Add the Google Services Gradle plugin (Capacitor 6 template):
mobile/android/build.gradle→buildscript { dependencies { ... } }:classpath 'com.google.gms:google-services:4.4.2'- bottom of
mobile/android/app/build.gradle:apply plugin: 'com.google.gms.google-services'
npx cap syncagain.
That's the client half. The server half (already built) needs the matching credential:
- Firebase console → Project settings → Service accounts → Generate new private key → download the JSON.
- On the production server, set
FCM_SERVICE_ACCOUNTto that file's path (or its inline JSON) and restart. See ../DEPLOY.md. With that set,push.sendToUserdelivers to Android devices automatically; the app already registers its token viaPOST /api/v1/deviceson launch (seesetupNativePushinserver/public/home.html).
5. Run it
npx cap open android # opens the project in Android Studio → press Run ▶
# or headless:
npx cap run android
First launch will prompt for notifications (Android 13+); accept it, then check the server log
/ DB device_tokens shows a row for your user.
Testing against a LOCAL dev server (optional)
The app points at https://remote.bizgaze.com by default. To hit your laptop instead, edit
capacitor.config.json:
"server": { "url": "http://<your-LAN-IP>:8090", "cleartext": true, "androidScheme": "https" }
then npx cap sync. (cleartext is required for plain http.) Revert before shipping.
6. Build for the Play Store
- Create an upload keystore (once):
keytool -genkey -v -keystore biz-connect.keystore -alias bizconnect -keyalg RSA -keysize 2048 -validity 10000 - Android Studio → Build → Generate Signed App Bundle → AAB → select the keystore.
(Or
cd android && ./gradlew bundleRelease.) - Upload the
.aabto Google Play Console (one-time $25 developer account). Fill in the store listing, data-safety form (declare camera/mic/notifications), and roll out to internal testing first.
Checklist
- Android Studio SDK + an emulator/device ready
npm install→npm run assets→npx cap add android→npx cap sync- Permissions added to AndroidManifest
google-services.jsoninandroid/app/+ Gradle plugin lines +cap sync- App runs; notification permission accepted;
device_tokensrow appears - Server
FCM_SERVICE_ACCOUNTset in prod → end-to-end push works - Signed AAB built and uploaded to Play (internal testing)