Files
openclaw/docs/platforms/android.md

170 lines
5.5 KiB
Markdown
Raw Normal View History

---
summary: "Android app (node): connection runbook + Connect/Chat/Voice/Canvas command surface"
read_when:
- Pairing or reconnecting the Android node
- Debugging Android gateway discovery or auth
- Verifying chat history parity across clients
title: "Android App"
---
2026-01-05 20:59:54 +01:00
# Android App (Node)
2026-01-07 21:37:05 +01:00
## Support snapshot
2026-01-31 21:13:13 +09:00
2026-01-07 21:37:05 +01:00
- 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](/channels/pairing).
2026-01-07 21:37:05 +01:00
- Gateway: [Runbook](/gateway) + [Configuration](/gateway/configuration).
- Protocols: [Gateway protocol](/gateway/protocol) (nodes + control plane).
2026-01-07 21:37:05 +01:00
## System control
2026-01-31 21:13:13 +09:00
2026-01-07 21:37:05 +01:00
System control (launchd/systemd) lives on the Gateway host. See [Gateway](/gateway).
2026-01-05 20:59:54 +01:00
## Connection Runbook
Android node app ⇄ (mDNS/NSD + WebSocket) ⇄ **Gateway**
Android connects directly to the Gateway WebSocket (default `ws://<host>:18789`) and uses device pairing (`role: node`).
2026-01-05 20:59:54 +01:00
### Prerequisites
- You can run the Gateway on the “master” machine.
- Android device/emulator can reach the gateway WebSocket:
- Same LAN with mDNS/NSD, **or**
- Same Tailscale tailnet using Wide-Area Bonjour / unicast DNS-SD (see below), **or**
- Manual gateway host/port (fallback)
2026-01-30 03:15:10 +01:00
- You can run the CLI (`openclaw`) on the gateway machine (or via SSH).
### 1) Start the Gateway
```bash
2026-01-30 03:15:10 +01:00
openclaw gateway --port 18789 --verbose
```
Confirm in logs you see something like:
2026-01-31 21:13:13 +09:00
- `listening on ws://0.0.0.0:18789`
For tailnet-only setups (recommended for Vienna ⇄ London), bind the gateway to the tailnet IP:
2026-01-30 03:15:10 +01:00
- Set `gateway.bind: "tailnet"` in `~/.openclaw/openclaw.json` on the gateway host.
- Restart the Gateway / macOS menubar app.
2026-01-05 20:59:54 +01:00
### 2) Verify discovery (optional)
From the gateway machine:
```bash
2026-01-30 03:15:10 +01:00
dns-sd -B _openclaw-gw._tcp local.
```
2026-01-10 14:51:21 -06:00
More debugging notes: [Bonjour](/gateway/bonjour).
2026-01-05 20:59:54 +01:00
#### Tailnet (Vienna ⇄ London) discovery via unicast DNS-SD
Android NSD/mDNS discovery wont 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-31 21:13:13 +09:00
1. Set up a DNS-SD zone (example `openclaw.internal.`) on the gateway host and publish `_openclaw-gw._tcp` records.
2. Configure Tailscale split DNS for your chosen domain pointing at that DNS server.
2026-01-10 14:51:21 -06:00
Details and example CoreDNS config: [Bonjour](/gateway/bonjour).
2026-01-05 20:59:54 +01:00
### 3) Connect from Android
In the Android app:
- The app keeps its gateway connection alive via a **foreground service** (persistent notification).
- Open the **Connect** tab.
- Use **Setup Code** or **Manual** mode.
- If discovery is blocked, use manual host/port (and TLS/token/password when required) in **Advanced controls**.
After the first successful pairing, Android auto-reconnects on launch:
2026-01-31 21:13:13 +09:00
- Manual endpoint (if enabled), otherwise
- The last discovered gateway (best-effort).
2026-01-05 20:59:54 +01:00
### 4) Approve pairing (CLI)
On the gateway machine:
```bash
openclaw devices list
openclaw devices approve <requestId>
openclaw devices reject <requestId>
```
Pairing details: [Pairing](/channels/pairing).
2026-01-05 20:59:54 +01:00
### 5) Verify the node is connected
2025-12-18 00:37:40 +00:00
- Via nodes status:
```bash
2026-01-30 03:15:10 +01:00
openclaw nodes status
```
- Via Gateway:
```bash
2026-01-30 03:15:10 +01:00
openclaw gateway call node.list --params "{}"
```
2026-01-05 20:59:54 +01:00
### 6) Chat + history
The Android Chat tab supports session selection (default `main`, plus other existing sessions):
- History: `chat.history`
- Send: `chat.send`
- Push updates (best-effort): `chat.subscribe``event:"chat"`
### 7) Canvas + screen + camera
2026-01-05 20:59:54 +01:00
#### Gateway Canvas Host (recommended for web content)
2025-12-18 11:39:30 +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
Note: nodes load canvas from the Gateway HTTP server (same port as `gateway.port`, default `18789`).
2026-01-31 21:13:13 +09:00
1. Create `~/.openclaw/workspace/canvas/index.html` on the gateway host.
2025-12-18 11:39:30 +01:00
2026-01-31 21:13:13 +09:00
2. Navigate the node to it (LAN):
2025-12-18 11:39:30 +01:00
```bash
openclaw nodes invoke --node "<Android Node>" --command canvas.navigate --params '{"url":"http://<gateway-hostname>.local:18789/__openclaw__/canvas/"}'
2025-12-18 11:39:30 +01:00
```
Tailnet (optional): if both devices are on Tailscale, use a MagicDNS name or tailnet IP instead of `.local`, e.g. `http://<gateway-magicdns>:18789/__openclaw__/canvas/`.
2025-12-18 11:39:30 +01:00
This server injects a live-reload client into HTML and reloads on file changes.
The A2UI host lives at `http://<gateway-host>:18789/__openclaw__/a2ui/`.
2025-12-18 11:39:30 +01:00
Canvas commands (foreground only):
2026-01-31 21:13:13 +09:00
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)
Camera commands (foreground only; permission-gated):
2026-01-31 21:13:13 +09:00
- `camera.snap` (jpg)
- `camera.clip` (mp4)
2026-01-10 14:51:21 -06:00
See [Camera node](/nodes/camera) for parameters and CLI helpers.
Screen commands:
- `screen.record` (mp4; foreground only)
### 8) Voice + expanded Android command surface
- Voice: Android uses a single mic on/off flow in the Voice tab with transcript capture and TTS playback (ElevenLabs when configured, system TTS fallback).
- Voice wake/talk-mode toggles are currently removed from Android UX/runtime.
- Additional Android command families (availability depends on device + permissions):
- `device.status`, `device.info`, `device.permissions`, `device.health`
- `notifications.list`, `notifications.actions`
- `photos.latest`
- `contacts.search`, `contacts.add`
- `calendar.events`, `calendar.add`
- `motion.activity`, `motion.pedometer`
- `app.update`