Created with AI because i don't have time to make everything myself, but it is pretty minimalistic and works so there should be no problems. Still i think it is only fair to add this disclaimer.
Android app to control Pear Desktop using the API from the included API Server Plugin.
- Auth flow using
POST /auth/{id}to obtain bearer token - Playback controls:
- previous, next, play, pause, toggle play/pause
- Seeking controls:
- seek-to, go-back, go-forward
- Volume + mute:
- set volume (0-100), toggle mute, volume state fetch
- Modes:
- shuffle, repeat switch, fullscreen toggle
- Song/State display:
- current song info, like state, repeat mode, shuffle/fullscreen state
- Periodic auto-refresh every 5 seconds
app/src/main/java/com/pearcontrol/app/MainActivity.kt- Compose UIapp/src/main/java/com/pearcontrol/app/MainViewModel.kt- UI/business stateapp/src/main/java/com/pearcontrol/app/PearRepository.kt- API operations and error handlingapp/src/main/java/com/pearcontrol/app/PearApiService.kt- Retrofit API models + endpoints
From workspace root:
.\gradlew.bat :app:assembleDebugAPK output:
app/build/outputs/apk/debug/app-debug.apk
- Start your Pear Desktop API server.
- Open this Android app.
- Enter:
- Server URL (example:
http://192.168.1.25:3000) - Auth ID (the ID expected by
/auth/{id})
- Server URL (example:
- Tap Connect.
- Use controls to manage playback.
- The app allows cleartext HTTP (
usesCleartextTraffic=true) for LAN control setups. - If your API uses HTTPS and a valid cert, HTTPS works as well.