Skip to content
k-l-lambdaPublic

About

An agentic android app

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

375 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anthroid

Anthroid logo

Anthroid is a native Android app for mobile agentic workflows: a Claude Code-style agent that can work with your phone’s native capabilities (camera, voice, clipboard, notifications, app/URL launching, location/calendar, screenshots, and optional UI automation).

Demos

Cross-App Automation

Launch other apps and automate multi-step tasks. Here the agent opens a shopping app, searches for products, and navigates the interface.

Cross-app automation demo

Remote Server Monitoring

Use voice commands to check server status. The agent connects via SSH, runs diagnostics, and reports back.

Server monitoring demo

Document Analysis & Local File Management

Take a photo or pick from gallery, then ask the agent to analyze. Here it reads insurance documents and creates a comparison report. The agent can also organize, rename, and move files on your device — tasks that are typically cumbersome on mobile due to limited input methods.

Document analysis demo

When it helps

  • On-call / incident triage away from your desk: run quick diagnostics in a terminal, keep a chat thread with context, and resume the conversation later.
  • Field work & device setup: scan QR codes to avoid retyping tokens/URLs, open links on-device, and copy/paste between apps.
  • Hands-busy workflows: dictate messages with offline speech recognition so you can keep moving even with poor network.
  • "What am I looking at?" troubleshooting: attach photos/screenshots for visual context, then follow a short step-by-step checklist.
  • Phone-use automation: copy key info to clipboard, open deep links, launch apps, set reminders via notifications, and combine device context (location/calendar) with instructions.

Overview

Anthroid (Android + Anthropic) is a mobile implementation of Claude Code, designed around mobile-native input methods and device capabilities.

Architecture Comparison

Unlike typical mobile AI apps that merely serve as a frontend to remote agent systems, Anthroid runs the full agent logic locally on your device:

Typical Mobile AI Apps Anthroid
flowchart TB
    subgraph phone["📱 Mobile Device"]
        ui["UI Only"]
    end
    subgraph server["☁️ Remote Server"]
        agent["Agent Logic"]
        tools["Tool Executor"]
    end
    subgraph cloud["☁️ LLM Provider"]
        api["LLM API"]
    end
    ui <-->|"Every action"| agent
    agent --> tools
    agent <--> api
Loading

❌ Tools run on remote server
❌ Limited device access
❌ Network latency for every action

flowchart TB
    subgraph phone["📱 Mobile Device"]
        subgraph runtime["Agent Runtime"]
            tools["Tool Executor<br/>Bash / Files / Camera / Voice"]
        end
    end
    subgraph cloud["☁️ Cloud"]
        api["LLM API<br/>(Claude / OpenAI compatible)"]
    end
    runtime <-->|"Inference requests"| api
Loading

✅ Tools execute locally
✅ Full device access
✅ Only LLM inference calls remote API
✅ Supports any OpenAI-compatible endpoint

This means Anthroid can directly access your camera, files, clipboard, and other device capabilities without round-tripping through a remote server.

Design goals

  • Device tools: access to location, calendar, clipboard, notifications, URL/app launching, and more.
  • Mobile input: voice dictation (offline sherpa-onnx) and camera capture/QR scanning.
  • Agent-style automation: optional overlay shows what the agent is doing when it operates outside the app.
  • Terminal at hand: a full bash environment for advanced workflows.

Features

Chat Interface

  • Native Android chat UI with streaming responses
  • Markdown rendering - Tables, bold, italic, code blocks, links
  • Conversation history - Resume past conversations
  • Light blue user bubbles, gray assistant bubbles

Voice Input

  • Offline speech recognition using sherpa-onnx
  • Supports Chinese, English, Japanese, Korean, Cantonese
  • Press-and-hold microphone button to speak
  • Real-time transcription display

Camera & Vision

  • Take photos to add visual context to messages
  • Gallery picker for existing images
  • Multiple images per message
  • QR code scanning with instant text insertion and clipboard copy

AI Agent Tools

Claude can execute tools on your device:

Tool Description
Bash Run terminal commands
Read/Write/Edit File operations
Glob/Grep Search files and content
Notification Show Android notifications
Clipboard Read/write clipboard
Open URL Launch browser
Launch App Open installed apps
Location Get GPS coordinates
Calendar Query calendar events
Screenshot Capture device screen
Screen Tap/Swipe UI automation

Screen Automation Overlay

When Claude launches other apps or performs actions outside Anthroid:

  • Floating banner appears at the top of screen showing agent status
  • Streaming text displays what Claude is currently doing
  • Stop button to cancel the operation at any time
  • Auto-hides after task completion (tap to return to Anthroid)
  • Requires overlay permission (Draw over other apps)

OpenClaw Agent Runtime (v1.0)

Local OpenClaw agent with full tool-use, model selection, and context management:

  • pi-embedded-runner bundled in APK — no external agent server needed
  • 60+ Android tools via MCP bridge (accessibility, camera, clipboard, notifications, etc.)
  • File-based memory — MEMORY.md + memory/*.md injected into system prompt, persists across sessions
  • Any LLM provider — Anthropic, OpenAI-compatible APIs, or proxy endpoints (e.g. PPIO)

Gateway Integration (Optional)

Connect to an OpenClaw gateway server for distributed agent features:

  • Memory sync — automatic pull/push of memory/ files on session start/end
  • Profile sync — /sync-profile command pulls agent identity, skills, and config files
  • Remote agent view — view and interact with OpenClaw sessions and SSH+tmux sessions on remote servers (see below)
  • Pending message delivery — messages queued while the phone is offline are drained on connect and every 60s (session.drainAllPending), de-duplicated against live events
  • System notifications — IM-like notifications for gateway messages, merged per agent, with cron job labels preserved; tapping opens the canonical session
  • Answer agent questions from the phone — agents that ask the user (OpenClaw ask-user, or any client of the gateway question protocol) post a sticky notification; tap to answer in a dialog supporting options, multi-select, free text and masked secret input. Dismissing cancels the question so the agent is released immediately
  • Standalone notices — session-less notification.push messages show their full text in a dialog (works offline, always shown even in foreground)
  • Status icon — the persistent notification switches to an "error robot" icon whenever the gateway is not connected
  • Live Update status (Android 16) — the gateway status is posted as a promoted ongoing notification, so ColorOS/OxygenOS 16 shows a status bar capsule with the stateful robot icon and "Online"/"Offline" (those ROMs otherwise draw the launcher icon for every notification). Requires the per-app Live Updates switch, see Gateway Setup
  • Freeze recovery — requests wait for the handshake, a liveness watchdog (gateway tick × 2.5) replaces sockets that died while the app was frozen, and pending agent questions are re-fetched after every reconnect
  • TLS — wss:// by default for manual connections; the gateway client trusts only the bundled gateway certificate plus an SPKI pin (scoped to the gateway connection, not app-wide). WebSocket is forced to HTTP/1.1 so upgrades work through HTTPS proxies
  • Gateway Settings UI — configure host/port/token in Settings, or use /set-gateway command / QR code

Remote Agent View

Open with /list-remotes (OpenClaw sessions) or /list-remotes <host> (tmux sessions over SSH):

  • OpenClaw sessions — full history with tool bar, live updates, reply injection, voice input, and date-aware timestamps
  • SSH + tmux sessions — lightweight capture-pane preview (never resizes the remote window), send-keys input with sync indicators
  • Native terminal attach — terminal icon opens the tmux session in a real Termux terminal (ssh -t … tmux attach); back returns to chat and closes the connection

Quick Send Candidates

  • Frequently used short messages appear as chips above the input bar
  • Tap to send immediately, long-press to insert into input for editing
  • Automatically tracked by frequency (threshold: 5 uses)

Terminal Environment

Built-in Linux terminal for advanced users:

  • Full bash shell environment
  • Package manager (apt/pkg)
  • Node.js, Python, and more available

SMS Library for Scripts

Scripts in the terminal can read the phone's SMS through the app (requires the SMS permission, requested at launch). It is a library rather than an agent tool: the agent filters messages in a script and prints only what it needs, so message bodies stay out of its context.

from anthroid_sms import query
msgs = query(since_minutes=10, address="95588")   # newest first, list of dicts
# fields: id, thread_id, address, date, date_sent, type, read, body
const sms = require('anthroid-sms');
const msgs = await sms.query({ sinceMinutes: 10, keyword: '验证码' });
anthroid-sms --status                 # app reachable + permission granted?
anthroid-sms --since-minutes 60       # count + metadata lines (no bodies)
anthroid-sms --from 10086 --body      # include bodies
anthroid-sms --keyword 验证码 --json   # full records

Filters: since / until (epoch ms), since_minutes, address (digits-only match, so 95588 matches +86 955 88), keyword, box (inbox | sent | all), unread_only, limit (1–200, default 20), offset.

The app serves requests on a Unix socket in its private directory, and connections from other apps (other uids) are rejected. Message bodies are never logged. This keeps bodies out of the agent's context when it uses the library sensibly; the agent can still read them itself.

Installation

Download APK

Get the latest release from GitHub Releases.

Build from Source

# Clone repository
git clone https://github.com/k-l-lambda/anthroid.git
cd anthroid

# Point the build at your Android SDK (git-ignored)
echo "sdk.dir=/path/to/Android/Sdk" > local.properties

# Build debug APK (JDK 17 required)
./gradlew assembleDebug

# Install on device
adb install -r app/build/outputs/apk/debug/anthroid-app_apt-android-7-debug_arm64-v8a.apk

Build notes:

  • JDK 17 is required by the Android Gradle Plugin; JDK 8/11 fail at configuration time.
  • SDK platform android-33, build-tools 33.x and the NDK must be installed.
  • First build takes ~5 minutes; incremental builds ~1 minute. After adding resources, run ./gradlew clean assembleDebug (stale incremental R classes can crash on launch with NoSuchFieldError).
  • Two APKs are produced: arm64-v8a (~190MB) and universal (~200MB).
  • A debug build with the same signing key upgrades in place (adb install -r) and keeps app data.

Requirements

  • Android 7.0+ (API 24)
  • ARM64 device recommended
  • ~200MB storage (+ optional 239MB for voice model)

Setup

API Configuration

API credentials live in a single place: the claude wrapper script ($PREFIX/bin/claude). All agent modes (CLI, API, OpenClaw) read from it.

  1. Get an API key from Anthropic Console (or any compatible endpoint)
  2. In the Anthroid terminal, run:
    set_wrapper <base_url> <auth_token> <model>
    # e.g. set_wrapper https://api.anthropic.com/ sk-ant-xxx claude-sonnet-4-5
    This also syncs the model into the OpenClaw agent's config.json.

Or use QR code for quick setup:

  1. Generate a set_wrapper QR code with tools/qr-generator.html
  2. Open the QR scanner (terminal drawer or chat camera)
  3. Scan — the command is pasted into the terminal for you to review and run

Voice Input Setup

  1. Go to Settings > Voice Input > Voice Recognition Model
  2. Download the ASR model (one-time)
  3. Wait for model initialization
  4. Microphone button appears in chat

Gateway Setup (Optional)

Connect to an OpenClaw gateway for memory sync and remote agent features:

  1. Go to Settings > Gateway Connection
  2. Enter host, port, and token
  3. Enable the toggle

Or use the chat command: /set-gateway <host:port> [token]

Or scan a QR code generated from tools/qr-generator.html.

Notes:

  • Manual connections default to TLS (wss://). The gateway client trusts only the certificate bundled at app/src/main/res/raw/kelvin_gateway.pem (plus its SPKI pin). To use your own self-signed gateway, replace that PEM (its SAN must contain the host you connect to) and rebuild.
  • The app connects with gateway protocol 4 and requests the operator.questions scope. After an upgrade that adds a scope, approve the device once on the gateway host: openclaw devices approve <requestId>.
  • For debugging over adb:
    adb shell am broadcast -a com.anthroid.DEBUG_CONFIG_GATEWAY -p com.anthroid \
      --es host '<host>' --es port '<port>' --ez tls true --es token '<token>'

OPPO / OnePlus / realme (ColorOS, OxygenOS)

  • Keep the connection alive in the background: App info > Battery usage > Allow background activity. The default "Smart mode" lets the system freeze Anthroid (and cut its network) even while the gateway foreground service runs, so the phone goes offline: messages arrive late and live agent questions are missed.
  • Status bar capsule (Android 16): App info > Notifications > enable Show Live Updates on Live Alerts. It is off by default; without it the status notification is a plain ongoing notification.
  • The launcher badge counts ongoing notifications regardless of channel badge settings, so a dot stays on the icon while the gateway is connected. Turning off "App icon badges" for Anthroid removes it, together with the badges of real messages.

Architecture

┌──────────────────────────────────────────────────┐
│  Anthroid App (Android)                          │
│                                                  │
│  ┌────────────────────────────────────────────┐  │
│  │  Kotlin Layer                              │  │
│  │  ├─ Chat UI (Markdown, voice, camera)      │  │
│  │  ├─ ClaudeViewModel (CLI/API/OpenClaw)     │  │
│  │  ├─ MCP Server (NanoHTTPD :8765)           │  │
│  │  ├─ Gateway Manager (WebSocket + sync)     │  │
│  │  └─ AndroidTools (60+ device tools)        │  │
│  └──────────────┬─────────────────────────────┘  │
│                 │ HTTP localhost:8765              │
│  ┌──────────────┴─────────────────────────────┐  │
│  │  Node.js Layer (OpenClaw Agent)            │  │
│  │  ├─ pi-embedded-runner (agent runtime)     │  │
│  │  ├─ android-tools-bridge.mjs (MCP bridge)  │  │
│  │  └─ workspace/ (memory, skills, data)      │  │
│  └────────────────────────────────────────────┘  │
│                                                  │
│  ┌────────────────────────────────────────────┐  │
│  │  Terminal (Termux fork)                    │  │
│  │  bash, Node.js, Python, apt/pkg            │  │
│  └────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────┘
         │                           │
         ▼                           ▼
   ☁️ LLM API              ☁️ OpenClaw Gateway
   (Claude/OpenAI)          (optional, WebSocket)

Key Technologies

  • Kotlin - Primary language
  • OpenClaw pi-embedded-runner - Local agent runtime with tool-use
  • CameraX - Camera capture
  • ML Kit - QR code scanning
  • sherpa-onnx - Offline speech recognition
  • Markwon - Markdown rendering
  • OkHttp - WebSocket for gateway connection
  • BouncyCastle - Ed25519 device authentication

License

GPLv3 - Same license as Termux. See LICENSE.md.

Credits

About

An agentic android app

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages