2025-12-14 01:54:58 +00:00
---
2026-01-05 20:59:54 +01:00
summary: "Android app (node): connection runbook + Canvas/Chat/Camera"
2025-12-14 01:54:58 +00:00
read_when:
- Pairing or reconnecting the Android node
2026-01-19 08:54:21 +00:00
- Debugging Android gateway discovery or auth
2025-12-14 01:54:58 +00:00
- Verifying chat history parity across clients
---
2026-01-05 20:59:54 +01:00
# Android App (Node)
2026-01-07 21:37:05 +01:00
## Support snapshot
- Role: companion node app (Android does not host the Gateway).
- Gateway required: yes (run it on macOS, Linux, or Windows via WSL2).
- Install: [Getting Started ](/start/getting-started ) + [Pairing ](/gateway/pairing ).
- Gateway: [Runbook ](/gateway ) + [Configuration ](/gateway/configuration ).
2026-01-19 08:54:21 +00:00
- Protocols: [Gateway protocol ](/gateway/protocol ) (nodes + control plane).
2026-01-07 21:37:05 +01:00
## System control
System control (launchd/systemd) lives on the Gateway host. See [Gateway ](/gateway ).
2026-01-05 20:59:54 +01:00
## Connection Runbook
2025-12-14 01:54:58 +00:00
2026-01-19 08:54:21 +00:00
Android node app ⇄ (mDNS/NSD + WebSocket) ⇄ **Gateway**
2025-12-14 01:54:58 +00:00
2026-01-19 08:54:21 +00:00
Android connects directly to the Gateway WebSocket (default `ws://<host>:18789` ) and uses Gateway-owned pairing.
2025-12-14 01:54:58 +00:00
2026-01-05 20:59:54 +01:00
### Prerequisites
2025-12-14 01:54:58 +00:00
- You can run the Gateway on the “master” machine.
2026-01-19 08:54:21 +00:00
- Android device/emulator can reach the gateway WebSocket:
2025-12-17 15:29:19 +01:00
- Same LAN with mDNS/NSD, **or**
- Same Tailscale tailnet using Wide-Area Bonjour / unicast DNS-SD (see below), **or**
2026-01-19 08:54:21 +00:00
- Manual gateway host/port (fallback)
2026-01-04 14:32:47 +00:00
- You can run the CLI (`clawdbot` ) on the gateway machine (or via SSH).
2025-12-14 01:54:58 +00:00
2026-01-19 08:54:21 +00:00
### 1) Start the Gateway
2025-12-14 01:54:58 +00:00
```bash
2026-01-06 23:27:58 +01:00
clawdbot gateway --port 18789 --verbose
2025-12-14 01:54:58 +00:00
```
Confirm in logs you see something like:
2026-01-19 08:54:21 +00:00
- `listening on ws://0.0.0.0:18789`
2025-12-14 01:54:58 +00:00
2026-01-19 08:54:21 +00:00
For tailnet-only setups (recommended for Vienna ⇄ London), bind the gateway to the tailnet IP:
2025-12-17 15:29:19 +01:00
2026-01-19 08:54:21 +00:00
- Set `gateway.bind: "tailnet"` in `~/.clawdbot/clawdbot.json` on the gateway host.
2025-12-17 15:29:19 +01:00
- Restart the Gateway / macOS menubar app.
2026-01-05 20:59:54 +01:00
### 2) Verify discovery (optional)
2025-12-14 01:54:58 +00:00
From the gateway machine:
```bash
2026-01-20 15:10:02 +00:00
dns-sd -B _clawdbot-gw._tcp local.
2025-12-14 01:54:58 +00:00
```
2026-01-10 14:51:21 -06:00
More debugging notes: [Bonjour ](/gateway/bonjour ).
2025-12-14 01:54:58 +00:00
2026-01-05 20:59:54 +01:00
#### Tailnet (Vienna ⇄ London) discovery via unicast DNS-SD
2025-12-17 15:29:19 +01:00
Android NSD/mDNS discovery won’ t cross networks. If your Android node and the gateway are on different networks but connected via Tailscale, use Wide-Area Bonjour / unicast DNS-SD instead:
2026-01-20 15:10:02 +00:00
1) Set up a DNS-SD zone (example `clawdbot.internal.` ) on the gateway host and publish `_clawdbot-gw._tcp` records.
2026-01-04 14:32:47 +00:00
2) Configure Tailscale split DNS for `clawdbot.internal` pointing at that DNS server.
2025-12-17 15:29:19 +01:00
2026-01-10 14:51:21 -06:00
Details and example CoreDNS config: [Bonjour ](/gateway/bonjour ).
2025-12-17 15:29:19 +01:00
2026-01-05 20:59:54 +01:00
### 3) Connect from Android
2025-12-14 01:54:58 +00:00
In the Android app:
2026-01-19 08:54:21 +00:00
- The app keeps its gateway connection alive via a **foreground service** (persistent notification).
2025-12-14 01:54:58 +00:00
- Open **Settings** .
2026-01-19 08:54:21 +00:00
- Under **Discovered Gateways** , select your gateway and hit **Connect** .
- If mDNS is blocked, use **Advanced → Manual Gateway** (host + port) and **Connect (Manual)** .
2025-12-14 01:54:58 +00:00
After the first successful pairing, Android auto-reconnects on launch:
- Manual endpoint (if enabled), otherwise
2026-01-19 08:54:21 +00:00
- The last discovered gateway (best-effort).
2025-12-14 01:54:58 +00:00
2026-01-05 20:59:54 +01:00
### 4) Approve pairing (CLI)
2025-12-14 01:54:58 +00:00
On the gateway machine:
```bash
2026-01-04 14:32:47 +00:00
clawdbot nodes pending
clawdbot nodes approve < requestId >
2025-12-14 01:54:58 +00:00
```
2026-01-10 14:51:21 -06:00
Pairing details: [Gateway pairing ](/gateway/pairing ).
2025-12-14 01:54:58 +00:00
2026-01-05 20:59:54 +01:00
### 5) Verify the node is connected
2025-12-14 01:54:58 +00:00
2025-12-18 00:37:40 +00:00
- Via nodes status:
2025-12-14 01:54:58 +00:00
```bash
2026-01-04 14:32:47 +00:00
clawdbot nodes status
2025-12-14 01:54:58 +00:00
```
- Via Gateway:
```bash
2026-01-04 14:32:47 +00:00
clawdbot gateway call node.list --params "{}"
2025-12-14 01:54:58 +00:00
```
2026-01-05 20:59:54 +01:00
### 6) Chat + history
2025-12-14 01:54:58 +00:00
The Android node’ s Chat sheet uses the gateway’ s **primary session key** (`main` ), so history and replies are shared with WebChat and other clients:
- History: `chat.history`
- Send: `chat.send`
- Push updates (best-effort): `chat.subscribe` → `event:"chat"`
2026-01-05 20:59:54 +01:00
### 7) Canvas + camera
2025-12-14 01:54:58 +00:00
2026-01-05 20:59:54 +01:00
#### Gateway Canvas Host (recommended for web content)
2025-12-18 11:39:30 +01:00
2025-12-18 13:18:24 +01:00
If you want the node to show real HTML/CSS/JS that the agent can edit on disk, point the node at the Gateway canvas host.
2025-12-18 11:39:30 +01:00
2026-01-19 08:54:21 +00:00
Note: nodes use the standalone canvas host on `canvasHost.port` (default `18793` ).
2025-12-20 17:13:36 +01:00
2025-12-18 13:18:24 +01:00
1) Create `~/clawd/canvas/index.html` on the gateway host.
2025-12-18 11:39:30 +01:00
2025-12-18 13:18:24 +01:00
2) Navigate the node to it (LAN):
2025-12-18 11:39:30 +01:00
```bash
2026-01-04 14:32:47 +00:00
clawdbot nodes invoke --node "< Android Node > " --command canvas.navigate --params '{"url":"http://< gateway-hostname > .local:18793/__clawdbot__/canvas/"}'
2025-12-18 11:39:30 +01:00
```
2026-01-04 14:32:47 +00:00
Tailnet (optional): if both devices are on Tailscale, use a MagicDNS name or tailnet IP instead of `.local` , e.g. `http://<gateway-magicdns>:18793/__clawdbot__/canvas/` .
2025-12-18 13:18:24 +01:00
2025-12-18 11:39:30 +01:00
This server injects a live-reload client into HTML and reloads on file changes.
2026-01-04 14:32:47 +00:00
The A2UI host lives at `http://<gateway-host>:18793/__clawdbot__/a2ui/` .
2025-12-18 11:39:30 +01:00
2025-12-14 01:54:58 +00:00
Canvas commands (foreground only):
2025-12-20 12:17:39 +00:00
- `canvas.eval` , `canvas.snapshot` , `canvas.navigate` (use `{"url":""}` or `{"url":"/"}` to return to the default scaffold). `canvas.snapshot` returns `{ format, base64 }` (default `format="jpeg"` ).
2025-12-18 10:44:50 +01:00
- A2UI: `canvas.a2ui.push` , `canvas.a2ui.reset` (`canvas.a2ui.pushJSONL` legacy alias)
2025-12-14 01:54:58 +00:00
Camera commands (foreground only; permission-gated):
- `camera.snap` (jpg)
- `camera.clip` (mp4)
2026-01-10 14:51:21 -06:00
See [Camera node ](/nodes/camera ) for parameters and CLI helpers.