feat(android): add an Android app
A Capacitor shell that opens a Sonda server in a WebView. It asks for the address of the server the first time and remembers it, trusts the certificate authorities installed on the phone, and keeps a notification with the controls so that the music goes on with the screen off. Fixes #47
This commit is contained in:
parent
995f2e5ae0
commit
ba10b8ef7b
1 changed files with 2948 additions and 0 deletions
19
README.md
19
README.md
|
|
@ -408,6 +408,25 @@ What it does today: sign in (and create the first account of a new server), brow
|
|||
|
||||
More commands, all run in `web/`: `npm test`, `npm run build`, and `npm run gen:api`, which rebuilds `src/api/schema.d.ts` from the OpenAPI spec (it fetches the generator with `npx`, so it needs the network once). `npm run build` writes to `internal/webui/dist` (git-ignored), not to `web/dist`.
|
||||
|
||||
## Android app
|
||||
|
||||
`android/` holds a small Android app: a Capacitor shell that opens a Sonda server in a WebView, with its own icon and no browser bars. It is for a phone whose browser cannot install a PWA. It has no copy of the web app: it shows the one of your server, so a new version of the server is a new version of the app.
|
||||
|
||||
- The first time it asks for the address of the server (`music.example.org`, or `http://192.168.1.5:8080`) and remembers it. Settings has Change server, shown only inside the app.
|
||||
- It trusts the certificate authorities installed on the phone, so a server behind a private CA opens once the CA is installed (Settings, Security, Install a certificate). It also opens a server on plain `http`.
|
||||
- A WebView has no Media Session API, so the app keeps its own: a notification with the song, its cover and the buttons, and the lock screen and headset buttons work. The music goes on with the screen off. From Android 13 it asks to show notifications; without a yes the music still plays and only the notification is hidden.
|
||||
|
||||
To build it you need Node, a JDK 21 and the Android SDK (platform 36 and its build tools; set `ANDROID_HOME`):
|
||||
|
||||
```bash
|
||||
cd android
|
||||
npm ci
|
||||
npm run apk # android/android/app/build/outputs/apk/debug/app-debug.apk
|
||||
adb install -r android/app/build/outputs/apk/debug/app-debug.apk
|
||||
```
|
||||
|
||||
The APK is signed with the debug key, which is fine for your own phone. It is not part of the release pipeline, because the runner has no Android SDK. `npm test` checks how an address typed by hand is read.
|
||||
|
||||
## Releases
|
||||
|
||||
Every merge into `main` can make a release, by itself (`.forgejo/workflows/release.yml`, [semantic-release](https://semantic-release.gitbook.io)). The next version comes from the messages of the commits since the last one, written as [Conventional Commits](https://www.conventionalcommits.org):
|
||||
|
|
|
|||
Loading…
Reference in a new issue