refactor: rename dashboards→webviews, unique applicationId per flavor
build / build (push) Failing after 3m11s
build / build (push) Failing after 3m11s
Each flavor gets applicationIdSuffix = ".<name>" so the Bravia getApplicationList API returns a distinct URI per webview, enabling Control4 to launch specific flavors independently. BREAKING CHANGE: applicationId changed from cz.c3c.webviewkiosk to cz.c3c.webviewkiosk.<flavor> — uninstall old app before reinstalling. BuildConfig.DASHBOARD_URL renamed to WEBVIEW_URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
# android-webview-kiosk
|
||||
|
||||
Fullscreen WebView kiosk for Android TV. Shows configurable Grafana dashboards
|
||||
defined in `dashboards.yaml`. Target device: Sony Bravia KD-65XE9305 (Android 8.0).
|
||||
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.
|
||||
|
||||
## Dashboards
|
||||
## Webviews
|
||||
|
||||
Defined in `dashboards.yaml` at repo root:
|
||||
Defined in `webviews.yaml` at repo root:
|
||||
|
||||
```yaml
|
||||
weather:
|
||||
@@ -18,7 +18,8 @@ house_condition:
|
||||
label: House Condition
|
||||
```
|
||||
|
||||
Each entry produces a separate APK. Names must be valid Gradle identifiers
|
||||
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
|
||||
@@ -38,9 +39,9 @@ APKs: `app/build/outputs/apk/<flavor>/release/<flavor>-release.apk`
|
||||
2. `adb connect <tv-ip>:5555`
|
||||
3. `adb install -r app/build/outputs/apk/weather/release/weather-release.apk`
|
||||
|
||||
Fresh install (removing old app first):
|
||||
Fresh install (first time or changing applicationId):
|
||||
|
||||
adb uninstall cz.c3c.webviewkiosk
|
||||
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
|
||||
@@ -51,15 +52,17 @@ with `-r`. Same committed keystore = no uninstall needed.
|
||||
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`
|
||||
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":"com.sony.dtv.cz.c3c.webviewkiosk.cz.c3c.webviewkiosk.MainActivity"}]}'
|
||||
-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.
|
||||
@@ -74,6 +77,6 @@ For reference, the two-step sequence (if needed for other integrations):
|
||||
# 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"}]}'
|
||||
-d '{"method":"setActiveApp","id":601,"version":"1.0","params":[{"uri":"<flavor-uri>"}]}'
|
||||
|
||||
Control4: a DriverWorks driver issuing `setActiveApp` is a separate project.
|
||||
|
||||
Reference in New Issue
Block a user