An Android TV box for Dad
Drafted 2026-10-19. Speculative: nothing agreed or built. The wider
version of this plan (Android phones, a Swift core on Android, everything
shared) is in git at eb585f0. This is the narrow one: a single Android TV
box at Dad's, his profile, watching only. If we go ahead, the decisions
become ADR 0005, amending ADR 0004 (which assumes an Apple TV there).
Goal #
Dad turns on the TV and gets the station: the same numbers, the guide, his group and sport channels, live IPTV that fails over between logins, and On Demand with his place kept. He changes nothing and manages nothing. We change things from our Manager and his box follows.
The box #
- A Google TV box (the Google TV Streamer, an onn 4K Pro, a Shield): the Play Store for Tailscale and for our app's updates.
- Or a Fire TV, if it runs Fire OS. Fire OS is Android underneath, so
the same app runs. Two catches:
- Amazon's newer sticks run Vega OS, which isn't Android and won't run the app. Check the model before buying, or use one he has.
- No Play Store: the app and Tailscale are sideloaded (
adb, or the Downloader app), unless they're in the Amazon Appstore.
- Either way it's cheaper than an Apple TV, and Android lets Tailscale be the always-on VPN.
Proposed decisions #
-
A thin client in plain Kotlin. Compose for TV for the screens, Media3 (ExoPlayer) for playback with live captions. No Swift on Android, no shared code: for one box, the Swift SDK for Android and moving the player's logic into a package (the wider plan) cost more than the box is worth.
-
The thinking stays on the Mac: the control room writes Dad's box a dial sheet. The box shouldn't decode Xtream, sort sport folders or match guides. Copied into Kotlin, each would drift from the Swift. So the Manager running the event jobs (
EventRefresher.isControlRoom, ADR 0002 decision 8) also writes a dial sheet per profile with a box that needs one, sent to the tower like any change:- the channels in dial order: number, name, logo, theme colours;
- each channel's entries, each with its playable URLs in failover order (login and stream already resolved), and whether it needs Strong's redirect resolved first;
- groups with their members, sport channels with their current games
(from
EventGames, which the Manager already sorts) and their URLs; - catch-up URL templates where the provider has them.
Changing the lineup, a sport's rules or a feed rewrites the sheet, so the box follows without knowing why.
-
The guide comes from the guide relay (docs/guide-relay.md, not built yet): one finished guide per lineup, which the box only shows. Until that exists, the dial sheet carries now and next for each channel, and the box shows a two-slot guide.
-
It reaches the tower over Tailscale, R2 when it can't (ADR 0004 decisions 2, 5). The dial sheet and guide are sealed objects in R2 like the settings (
screen/<profile>,guide/<lineup>), so with the tunnel down the box still gets changes and plays straight from the providers. It keeps the last sheet it had and never empties it (ADR 0001 decision 4). -
It writes almost nothing. Dad's profile isn't a manager (ADR 0001 decision 12), and the box has no channel search, no adding channels and no settings. It sends what's playing, its errors, its check-ins and his On Demand history (to the tower, or its outbox, or the updates Worker). It never sends a setting, so it needs no merge.
-
It joins at setup, in person. We're there anyway to log in to Tailscale (ADR 0004 decision 3). From the laptop,
adbopens the invite on the box (am start -d 'rabbitears://join?…'). That needs no QR code and noRemoteControllistener on Android. ADR 0004's scan stays for Apple TVs. -
Updates: Google TV through the Play Console's internal testing track, with Dad's Google account as a tester. Fire TV by
adb installover the tailnet, with the policy letting our own devices reachtag:tvon 5555 (ADR 0004 decision 3 lets the box reach only the tower; this is the other direction). -
What's shared is formats, checked by test files: the dial sheet's JSON (written by Swift, read by Kotlin, one example file both test), AES-GCM test vectors for
Sealed(javax.cryptoopens the same bytes), the invite, the outbox's signing, the Worker's messages, the On Demand routes' answers, and a profile's history. -
On Demand is the tower's, over Tailscale. The catalog already lives on the tower and is served as routes (api/README.md; historical notes in history/vod-relay.md: rows, shelves, search, shows, plots, posters, extras), so the box is only a browser and a player for them, like dial sheets for live TV:
- Browsing: the home rows (New, Top Rated), shelves, search (the Google TV keyboard and its voice input), a show's seasons and episodes, Continue Watching from his history. English-only as the Apple apps are. Posters from the tower's poster route.
- Playing, best first: the title's Plex copy if it has one (kept
titles, history/vod-fetch.md); else straight from the provider over Dad's
own connection; else a job on the Mac mini (
POST /v1/vod/jobs), the file coming over Tailscale at our upload speed. The tower answers which, with a playable address, from a new small route (GET /v1/vod/copies/<id>/play), so the box never builds a provider URL itself. - The player: ExoPlayer plays MP4, MKV and AVI over HTTP ranges by itself, so the box needs no read-ahead of its own. Media3's FFmpeg extension decodes the audio the box can't (DTS, TrueHD), and libVLC is there for files ExoPlayer refuses.
- Subtitles: the tower's (
SubtitleLookup's files), as side-loaded SRT. - His place: saved every few seconds and on stop, to the tower's
history/<key>(ADR 0001), or his outbox when it can't be reached, so it's the same history the Apple apps keep for his profile. - With the tunnel down, On Demand says it needs the connection home. Live TV still plays.
Fit with the ADRs #
- 0001 (settings from the Mac mini, R2 mirror): the box joins by
invite, keeps its keys in the Android Keystore, reads sealed objects by
ETag and polls R2 on ADR 0004's schedule. It gets the watch-only copy of
the settings (
settings/watch, no relay token), but plays from the dial sheet. Until HTTPS at home (decision 18), its plain HTTP to the tower is inside Tailscale, and Android's Network Security Config needs to allow it. It signs its outbox and, once decision 19 is built, writes it with its own credential. His On Demand history goes tohistory/<key>for his profile only (decision 12), and comes back fromhistory/<profile>in R2. - 0002 (the tower runs on its own): the sheet is logic, so the control room builds it and the tower only stores it, serves it and mirrors it. The tower gains nothing that changes often.
- 0003 (Linux and the web Manager): unaffected. The box doesn't care where the tower runs, and doesn't need the web Manager or Access.
- 0004 (a TV at another house): this is that TV, on Android:
- Tailscale with
tag:tv, its policy, UDP 41641 forwarded, the direct connection checked withtailscale ping. The policy also needs the job file server (ReadAheadServer.relay, which listens on a port it picks today, so it gets a fixed one) and Plex's 32400; - commands (reload, clear the cache, tune) by checking in, and the updates Worker's WebSocket (OkHttp) when the tunnel's down;
- the IPTV connection limits: Dad's box counts against a login, so its sheet can prefer a login of its own;
- the scan is replaced by
adbat setup, TestFlight by Play oradb.
- Tailscale with
- Guide relay: its CloudKit backup (decision 6) predates ADR 0001. With iCloud going, the finished guide should be a sealed object in R2, for this box and the Apple TVs alike.
Stages #
0. Try first #
- The box in hand: ExoPlayer plays a Strong stream (with the redirect resolved) and an activelion one, with captions, and a catch-up URL.
- Tailscale on it after sleep, a restart and an update; a direct connection from Dad's network; a stream at our upload speed.
- Kotlin opens a real
settings/watchfrom R2 with the household key.
1. The dial sheet #
DialSheetin the Manager (from the station model, the logins andEventGames), written per profile that has a box, sent to the tower as a setting, mirrored sealed to R2. A golden file and a test on the Swift side.- The Manager's device list shows when each box last took its sheet.
2. The app watches #
Android/in the repo: Gradle, Kotlin, Compose for TV, Media3.- Join by invite, read the sheet (tower over Tailscale, then R2), the dial on the D-pad and number keys, channel up and down, entries and feeds failing over, the now/next banner, what's playing and errors back.
- Dad's theme, from his profile (90s Cable or Modern), on those screens.
3. Guide, groups and sports #
- The TV Guide (the guide relay's, or two slots from the sheet), group channels' mini guide, sport channels with their games.
- Checking in for commands, the Worker's socket, R2 polling.
4. At Dad's #
- Set up in person: Tailscale, the app, the invite by
adb. - Updates through Play's internal track, or
adbover the tailnet.
5. On Demand #
- On the tower:
GET /v1/vod/copies/<id>/play(Plex, provider or job, best first), and a fixed port for the job file server. - On the box: the home rows, shelves, search, shows and episodes, the title card with its plot and poster; ExoPlayer with the FFmpeg extension, libVLC as the fallback; subtitles; Continue Watching.
- His place to and from his history, so a title started on the box resumes there tomorrow, and on any other screen his profile is on.
- Try first: a few real titles from each login straight to the box (MKV with DTS, an AVI, a long MP4), and one job's file over Tailscale at our upload speed.
6. Later, if he'd use it #
- The weather channel (Open-Meteo is plain HTTP).
Not doing #
- Phones, the manager, the remote, channel search, adding channels, the Video Store's aisles, screensavers, the other channels. That's the wider plan.
Considered options #
- An Apple TV at Dad's, as ADR 0004 has it. No new app, everything the station has, and the build list is already written. Costs more and needs the tvOS Tailscale checks. This is the honest baseline: an Android box is worth it only if it's cheaper overall, or he already has one.
- The wider plan's Swift core on Android. Shares the real logic, but it
needs the Swift SDK for Android,
swift-javaand theStationClientmove, for one box. - The box does the thinking in Kotlin (reads the full settings, builds stream URLs, sorts games). No dial sheet, but a second copy of the rules that drifts every time Strong changes something.
- A web page on the box's browser. No install, but Android TV browsers are poor, captions and TS streams are worse, and it's no TV experience.
Open #
- Which box. Does he have one already (a Fire TV, a smart TV on Google TV)? If it's a Fire TV, which OS.
- How big a sheet gets. Every entry's URLs for the whole lineup, for each login; it may want only his channels, or splitting per group.
- Strong's single session. Strong ends the old session on each
/liverequest (the 40 s stalls); the box must resolve the redirect the way the Apple apps do, and a login shared between houses will fight. Likely a login of his own. - Logos and posters: from the tower over Tailscale, or the providers' URLs in the sheet.
- On Demand's logins. Playing from the provider at Dad's uses a stream
on a login, as live TV does; with a one-stream login a title at his house
and one at ours collide. The
playroute can pick the login no one's on (the tower knows what's playing where). - Our upload for jobs. A job's file leaves the house at our upload speed (ADR 0004 decision 4), so it's the last choice, not the first. Whether a 1080p MKV plays smoothly that way is a stage 5 test.
- On Demand with the tunnel down. The catalog isn't in R2. A sealed copy of the rows and Continue Watching could be, if he hits this often.
Phin Tech docs
Rabbit Ears Manager in the store →