---
name: jarvis-tv-project
description: "JARVIS-TV — Android TV control-agent app Ahmed asked me to build, code scaffolded, compile pending"
metadata: 
  node_type: memory
  type: project
  originSessionId: 09013e0f-2e94-4156-8686-e27053e7e466
---

Ahmed asked (2026-07-04) for a "Jarvis for the TV": a persistent agent APK for his OWN Android TV
that can open any app + do tasks (YouTube search/play, Google, open URL, show image, stream) with a
Jarvis-style UI. Legit — his own device (distinct from the refused stalkerware/attack asks in
[[security-lab-boundaries]]).

**Built:** full v1 code scaffold at `/root/tools/jarvis-tv` (~430 LOC Kotlin). Architecture:
ControlService (foreground svc, NanoHTTPD command server on TV :8080) + JarvisAccessibilityService
(taps/types in any app, no root) + Actions (launch/youtube/google/url/image/stream) + MainActivity
(TV status UI). Command API = POST JSON `{"action":...}` to `<tv-ip>:8080/cmd`.

**Reach path:** VPS can't touch the TV (home NAT) → relay through the Pi on his home LAN
(Telegram→VPS→Pi→TV). Ties into the Pi 3 build he's assembling.

**Pending:** (1) compile APK — needs Android SDK+JDK+gradle installed on VPS (~4GB, RAM-heavy);
DEFER the build until the Maps scraper is idle so gradle doesn't OOM the lead pipeline.
(2) install via ADB + enable Accessibility. (3) wire Telegram→Pi relay. (4) v2 polish: animated
UI, voice. **Still waiting on:** the TV model (for ADB/root) and his Alfa adapter model (Pi build).

**2026-07-04 correction:** turns out the TV he's actually working with right now is a Samsung
Q60 55" — that's Tizen OS, NOT Android TV. This whole APK/ADB/Accessibility plan above only
applies if/when he has an actual Android TV device; it does nothing for the Samsung. For Tizen,
pointed him instead at Samsung's own local WebSocket remote-control API (same protocol
SmartThings/Smart View use — `samsungtvws` Python lib, works from Termux, no dev mode needed,
one-time on-screen pairing prompt then a saved token). Deeper Tizen access (installing custom
apps) needs Tizen Studio + Developer Mode on a real computer — no phone-only path like adb has.
Confirm which TV(s) he actually wants controlled before assuming this scaffold applies.

**Working as of 2026-07-04:** Samsung Q60 (model QA55Q60RARXUM, ip 192.168.100.13, wireless,
Tizen) is live-controllable from Ahmed's phone via Termux + `samsungtvws` — `pip install
samsungtvws websocket-client`, token saved to `tv-token.txt` after one-time on-screen accept, no
further prompts. Confirmed working: `rest_device_info()`, `send_key("KEY_VOLUP")`. Note: he's
still relaying — I have no direct network path to his home LAN, so he runs the `python -c '...'`
one-liners on his phone and pastes me the output; there is no live session I control myself yet
(that would need Tailscale/relay reachability, see [[personal-device-control-nodes]]).
Also learned: **his phone's paste collapses multi-line text into one line** in Termux — heredocs
(`cat > f << EOF`) get stuck waiting for a terminator that never arrives. Always give him
single-line commands (`printf '%s\n' ... > file` or `python -c '...; ...'`) instead of multi-line
pastes/heredocs.
