Files
android-webview-kiosk/README.md
T
Arnie via Claude 5af5b4513d
build / build (push) Failing after 4m29s
feat: gitea CI (test + apk artifact), repo docs
2026-06-12 15:10:13 +02:00

56 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# android-webview-kiosk
Fullscreen WebView kiosk for Android TV. Shows the house Grafana dashboard:
<https://grafana.c3c.cz/public-dashboards/381fe3e71e164eb99dd0b10e246a36e2>
Target device: Sony Bravia KD-65XE9305 (Android 8.0). Built for remote
launch via the Bravia REST IP-control API, driven by Control4.
## Build
nix develop --command gradle --no-daemon :app:assembleRelease
APK: `app/build/outputs/apk/release/app-release.apk`
## Sideload
1. TV one-time: Settings → About → press *Build* 7× → Developer options →
enable ADB debugging.
2. `adb connect <tv-ip>:5555`
3. `adb install -r app/build/outputs/apk/release/app-release.apk`
Upgrades: bump `versionCode` in `app/build.gradle.kts`, rebuild, reinstall
with `-r`. Same committed keystore = no uninstall needed.
## Remote launch (Sony Bravia IP control)
TV prerequisite: IP control auth = "Normal and Pre-Shared Key", Remote
start enabled (wake from deep standby).
App URI (from `getApplicationList`):
`com.sony.dtv.cz.c3c.webviewkiosk.cz.c3c.webviewkiosk.MainActivity`
**`setActiveApp` alone wakes the TV from standby** — no separate
`setPowerStatus` call is needed. The Control4 driver can use a single call:
curl -s -X POST http://$TV_IP/sony/appControl \
-H "X-Auth-PSK: $PSK" -H 'Content-Type: application/json' \
-d '{"method":"setActiveApp","id":601,"version":"1.0","params":[{"uri":"com.sony.dtv.cz.c3c.webviewkiosk.cz.c3c.webviewkiosk.MainActivity"}]}'
If the TV is already on, `setActiveApp` brings the kiosk to the foreground.
If in standby, it wakes and launches directly.
For reference, the two-step sequence (if needed for other integrations):
# 1. wake (optional — setActiveApp does this implicitly)
curl -s -X POST http://$TV_IP/sony/system \
-H "X-Auth-PSK: $PSK" -H 'Content-Type: application/json' \
-d '{"method":"setPowerStatus","id":55,"version":"1.0","params":[{"status":true}]}'
# 2. launch (~6 s from quick standby, up to ~30 s from deep eco standby)
curl -s -X POST http://$TV_IP/sony/appControl \
-H "X-Auth-PSK: $PSK" -H 'Content-Type: application/json' \
-d '{"method":"setActiveApp","id":601,"version":"1.0","params":[{"uri":"com.sony.dtv.cz.c3c.webviewkiosk.cz.c3c.webviewkiosk.MainActivity"}]}'
Control4: a DriverWorks driver issuing `setActiveApp` is a separate project.