Files
arnie b57e65f760
build / build (push) Has been cancelled
chore: upgrade toolchain to AGP 9.2.1 / Gradle 9 / nixpkgs 26.05
- nixpkgs 25.11 → 26.05; gradle_9 + jdk21; build-tools 35 → 36
- Drop custom gradle wrapper — GRADLE_OPTS works post-nixpkgs PR #449037
- AGP 8.7.3 → 9.2.1; Kotlin plugin removed (built-in since AGP 9)
- compileSdk/targetSdk 34 → 35; buildToolsVersion pinned to 36.0.0
- Java/Kotlin target 17 → 21; resValues feature flag required by AGP 9
- applicationVariants (removed in AGP 9) → androidComponents.onVariants
- Test task: testWeatherReleaseUnitTest → :app:test (all flavors, debug)
- CI artifact path fixed to cover all flavor APKs
- Docs: drop nix develop --command prefix (direnv activates shell)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 20:12:22 +02:00

83 lines
3.0 KiB
Markdown
Raw Permalink 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 configurable web pages
defined in `webviews.yaml`. Target device: Sony Bravia KD-65XE9305 (Android 8.0).
Built for remote launch via the Bravia REST IP-control API, driven by Control4.
## Webviews
Defined in `webviews.yaml` at repo root:
```yaml
weather:
url: https://grafana.c3c.cz/public-dashboards/...
label: Weather # shown in Bravia launcher
house_condition:
url: http://grafana.c3c.cz/public-dashboards/...
label: House Condition
```
Each entry produces a separate APK with a unique `applicationId`
(`cz.c3c.webviewkiosk.<name>`). Names must be valid Gradle identifiers
(letters, digits, underscores — no hyphens).
## Build
# all flavors
gradle --no-daemon :app:assembleRelease
# single flavor
gradle --no-daemon :app:assembleWeatherRelease
APKs: `app/build/outputs/apk/<flavor>/release/<flavor>-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/weather/release/weather-release.apk`
Fresh install (first time or changing applicationId):
adb uninstall cz.c3c.webviewkiosk.<flavor>
adb install app/build/outputs/apk/<flavor>/release/<flavor>-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).
Each webview flavor has its own URI — retrieve per-flavor URIs via
`getApplicationList`. Example for `weather` (`cz.c3c.webviewkiosk.weather`):
`com.sony.dtv.cz.c3c.webviewkiosk.weather.cz.c3c.webviewkiosk.weather.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":"<flavor-uri>"}]}'
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":"<flavor-uri>"}]}'
Control4: a DriverWorks driver issuing `setActiveApp` is a separate project.