Convert Windows app to Electron and add Android Capacitor app with CI builds
This commit is contained in:
34
android-app/README.md
Normal file
34
android-app/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Android App (Capacitor)
|
||||
|
||||
This folder contains the Android app build for the project. The app reuses the existing web UI (apps and builder screens) and wraps it with Capacitor for native Android deployment.
|
||||
|
||||
## Goals
|
||||
- Reuse the existing web UI with minimal divergence.
|
||||
- Provide a native Android APK for distribution.
|
||||
- Sync apps between device and backend.
|
||||
- Build via GitHub Actions; do not build locally.
|
||||
|
||||
## How it works
|
||||
- **UI reuse:** `npm run prepare-ui` copies `../chat/public` into `www` and injects a bridge script so existing pages can talk to native APIs.
|
||||
- **Native bridge:** Capacitor provides native access to preferences and HTTP requests.
|
||||
- **Local storage:** Apps are saved using Capacitor Preferences plugin, isolated per user.
|
||||
- **Syncing:** `syncApp` posts the locally saved app JSON to the backend.
|
||||
|
||||
## Setup
|
||||
1. Install prerequisites (Node 18+, Android SDK).
|
||||
2. From this folder: `npm install`.
|
||||
3. Pull UI assets: `npm run prepare-ui`.
|
||||
4. Add Android platform: `npx cap add android`.
|
||||
5. Sync: `npx cap sync android`.
|
||||
|
||||
## Development
|
||||
- `npm run build` prepares UI and syncs with Android.
|
||||
- `npx cap open android` opens Android Studio for development.
|
||||
|
||||
## CI build
|
||||
- GitHub Actions workflow: `.github/workflows/build-android-app.yml`.
|
||||
- The action runs on `ubuntu-latest`, sets up Java/Android SDK, and builds the APK.
|
||||
|
||||
## Security notes
|
||||
- API keys are stored in Capacitor Preferences (encrypted on Android).
|
||||
- OpenCode execution is not supported on mobile (desktop app only).
|
||||
Reference in New Issue
Block a user