1# Airwaves for Android TV23A thin shell around the server's TV page: a fullscreen WebView on4`<server>/tv/` (airwavesd serves it), with a native setup screen for the server5address. Android 9 or later, for Google TV and Android TV.67## Build89Needs a JDK 17 or later and the Android SDK (platform 36), found through10`ANDROID_HOME` or `sdk.dir` in `local.properties`.1112```sh13cd android14./gradlew assembleDebug # app/build/outputs/apk/debug/app-debug.apk15```1617## Install1819```sh20adb connect 192.168.1.50:5555 # the TV, over wireless debugging (below)21adb -s 192.168.1.50:5555 install -r app/build/outputs/apk/debug/app-debug.apk22adb -s 192.168.1.50:5555 shell am start -n dev.airwaves.tv/.MainActivity --es server nas:808923```2425Or all of it, from the repo: `scripts/android.sh 192.168.1.50:5555 [nas:8089]`.26The `server` extra is optional: without one, the app asks at first run.2728### Wireless debugging on a Google TV29301. Settings > System > About: select **Android TV OS build** seven times, until31 it says you're a developer.322. Settings > System > Developer options: turn on **Wireless debugging**33 (USB debugging too, if it asks). The TV and the computer must be on the34 same network.353. In Wireless debugging, choose **Pair device with pairing code**. It shows an36 address with a pairing port and a six-digit code: run37 `adb pair 192.168.1.50:37123` and enter the code. Pairing is once per computer.384. Connect to the address and port listed under Wireless debugging itself39 (not the pairing port): `adb connect 192.168.1.50:41235`. That port changes40 when the TV restarts; `adb devices` lists what's connected.4142Older Android TV (before Android 11) has **Network debugging** instead:43`adb connect 192.168.1.50:5555` and accept the prompt on the TV.4445## Using it4647- First run, or when the page can't load: setup. Enter the server (`nas:8089`;48 no port means 8089) and Connect; it checks `/api/info` before saving.49- Back goes to the page (`window.airwavesBack()`); when the page has nothing50 to close, Back twice exits. Hold Back, or press Menu, for setup.51- The remote's keys reach the page as keydown events: arrows, Enter (center),52 digits, `MediaPlayPause`, `MediaPlay`, `MediaPause`, `MediaFastForward`,53 `MediaRewind`, `MediaTrackNext`, `MediaTrackPrevious`, `MediaStop`,54 `MediaRecord`, `ChannelUp`, `ChannelDown`, `MediaLast`, `Guide`, `Info`,55 `ClosedCaptionToggle`, `ColorF0Red` and the other colors. The app keeps these56 keys even when the page ignores them.57- In the background the page is hidden (`visibilitychange`) and what's playing58 pauses; it resumes on return. A page can take that over with59 `window.airwavesPause()` and `window.airwavesResume()`. If the WebView's60 renderer dies, the page reloads.6162The page talks to the app through `window.AirwavesAndroid`: `getServer()`,63`setServer(url)` (saves it and loads its TV page; `""` opens setup),64`openSetup()`, `getVersion()`, `copyText(text)`, `openUrl(url)` (false when no65app opens it, as for web links on a Google TV, which has no browser),66`log(level, msg)` (logcat tag `Airwaves`) and `exit()`. The user agent ends in67` AirwavesTV/<version>`.6869Debug builds can be inspected from Chrome's `chrome://inspect` on the computer.7071## Art7273The banner, the launcher icon and the setup wordmark are rendered from the HTML74in `art/` (the Steam art's look and the desktop icon's W):75`PLAYWRIGHT=/path/to/node_modules/playwright/index.mjs node android/art/render.mjs`.