# Namma Agent for Android A native Android app (Kotlin + Jetpack Compose, Material 3) for your Namma Agent. It talks to an agent you run yourself: on your desktop, a home server or a hosted VM. Everything happens on that agent; the app is a fast, native window onto it. **Features:** streaming chats with tool steps, approvals and stop; Projects (chats, documents, notes, the coding agent's workspace); the Learning Room (paths, lessons, native question cards, insights); personas and specialists; memory; routines and watchers; models, toolsets, skills and MCP servers; messaging status and trust; linked devices and pairing; several servers; background notifications; voice dictation and read-aloud with the phone's own speech engines; Material You and the web app's themes, light and dark. It looks and works like the desktop app. It uses the same brand art (the coin medallion and the engraved persona coins), the painted-paper backdrop with its ink drawing, the same five themes and colour tokens, the same Tabler icons and Roman role emblems, Cinzel / Gelasio for headings, and the same Agent · Chat · Setup modes. The desktop's sidebar becomes a floating capsule bar (Chats · Projects · Learning · Memory · Settings). Settings has every desktop section: Behavior, Persona, Appearance, Notifications, Model (providers, keys, models, and an add-a-model wizard), Skills, Toolsets, MCP (with the catalogue), Routines & watchers, Messaging, Devices, Memory, Security, Checkpoints, Learning, Status and About. A first-run setup screen appears if the agent has no model yet. Chats render like the desktop: Markdown, tables, ```mermaid diagrams and `$…$` / `$$…$$` maths, drawn with the web UI's own mermaid and KaTeX (vendored in `app/src/main/assets/web/`; simple inline maths is shown natively). Tap a diagram or formula to zoom. The Memory tab has the knowledge graph (pan, zoom, tap an entity for its links and sources), ranked entities, core memory and search. ## Daily use 1. Install `NammaAgent-.apk` from the [latest release](https://github.com/SanthoshReddy352/Namma-Agent/releases/latest). Android asks once to allow installs from your browser or file manager. 2. Make a pairing code on your agent: Settings → **Devices** → *Pair a phone*, `/pair` on Telegram, or `namma devices pair`. 3. In the app tap **Scan pairing QR code**. You can also type the address and code. Where the agent runs, and how the phone reaches it (LAN, tunnel, Oracle Cloud with HTTPS), is covered in [docs/REMOTE_ACCESS.md](../../docs/REMOTE_ACCESS.md). ### No computer or server: run the agent on the phone Tap **Run the agent on this phone** (connect screen, or Settings → Agents). The phone then calls the model provider itself with your API key (Anthropic, OpenAI, Gemini, OpenRouter, Groq, DeepSeek, Mistral, xAI, OpenCode Zen, or any OpenAI-compatible URL; the key is sealed with the phone's keystore). Its tools are the phone's, not the desktop's: - web search and page reading; files in its own private workspace (attachments land in `uploads/`), with *Save to Downloads* to share one; - email, text, calls, calendar events, alarms, timers, maps and sharing open the right app with everything filled in — you tap Send or Save there; - reminders and notifications, its own memory (the Memory tab), a plan strip, and sub-agents that research in parallel (shown above the composer). No shell and no access to the rest of the phone's files. Deleting a file, reading the clipboard and saving to Downloads ask first (Settings → Behavior → Auto mode turns that off). Projects, the Learning Room, MCP and messaging bridges stay desktop/server features. Switch between this phone and your other agents in Settings → Agents. ## Voice - **Dictation:** tap the mic in the composer. Android's `SpeechRecognizer` (Google's speech services on most phones) transcribes as you speak, into the message box. It's free and needs no key. Install the offline language pack (Settings → System → Languages → Speech) to dictate without a connection. Phones without a recogniser fall back to the system voice dialog. - **Read aloud:** the speaker button under a reply uses the phone's `TextToSpeech` voice. Turn on *Read replies aloud* in a chat's options (the sliders icon) to hear every new reply. ## Develop Requirements: Android Studio (Ladybug or newer) or its bundled JBR (JDK 21+), and Android SDK 36. ```bash cd mobile/android ./gradlew assembleDebug # app/build/outputs/apk/debug/app-debug.apk ./gradlew installDebug # onto a connected phone (USB debugging on) ./gradlew testDebugUnitTest # unit + screen tests (Robolectric), no device needed ``` On Windows, use `gradlew.bat`. If your default `java` is very new, point `JAVA_HOME` at Android Studio's JBR first (`C:\Program Files\Android\Android Studio\jbr`). **Testing against an agent running from source:** start the agent with `python -m namma_agent serve --lan` (same Wi-Fi) or `python -m namma_agent serve --tunnel cloudflared` (anywhere), then scan the QR it prints. The debug build installs next to the release build as `com.namma.agent.debug`, so you can keep both. **On an emulator.** An Android 16 (API 36) Google Play image is a good match: it includes Google's speech recogniser, so you can test dictation too. To keep the large files off C:, put the SDK and the emulator on another drive: ```powershell $env:ANDROID_SDK_ROOT = "D:\Android\Sdk"; $env:ANDROID_AVD_HOME = "D:\Android\avd" # the system image and the device (sdkmanager's .bat splits ";", so use a package file) Set-Content D:\Android\pkgs.txt "system-images;android-36;google_apis_playstore;x86_64`nplatform-tools`nemulator" D:\Android\Sdk\cmdline-tools\latest\bin\sdkmanager.bat --sdk_root=D:\Android\Sdk --package_file=D:\Android\pkgs.txt D:\Android\Sdk\cmdline-tools\latest\bin\avdmanager.bat create avd --name NammaPixel --device pixel_8 --package "system-images;android-36;google_apis_playstore;x86_64" D:\Android\Sdk\emulator\emulator.exe -avd NammaPixel ``` Then turn on phone access on the agent (Settings → Devices → **Allow phones on this Wi-Fi**, or `python -m namma_agent serve --lan`), install with `./gradlew installDebug`, and connect to `http://10.0.2.2:8765` (from inside the emulator, the computer is `10.0.2.2`). The first boot of a fresh Play image is slow while Google Play services compile in the background. Give it a few minutes, and close heavy apps if the host is low on RAM. **Regenerating assets:** `python mobile/android/tools/make_launcher.py` (launcher icon from the desktop's `icon.png`), `make_icons.py` (Tabler icons and Roman emblems), and `vendor_web.py` (mermaid and KaTeX from `namma_agent/webui/node_modules`). **Screen tests:** `ScreensTest` renders every main screen against a fake agent (`FakeAgent.kt`) and writes PNGs to `app/build/screenshots/`. CI uploads them as the `android-screens` artifact, so UI changes can be reviewed without a device. ### Layout ``` app/src/main/java/com/namma/agent/ data/ Api (REST), ChatSocket (live /ws with resume), ServerStore (profiles; keys sealed in Android Keystore), Json helpers ui/ Root (navigation + capsule bar), Load (data loading, pull-to-refresh) ui/chat/ ChatViewModel (streaming protocol), ChatScreen, Voice (STT/TTS) ui/screens/ Connect, Chats, Projects, Learn, Agents, More (+ settings sub-screens) ui/components/ Common (capsule bar, rows, states, dialogs), Markdown, QuestionCard work/ InboxWorker (background notifications) ``` The app reads the server's JSON loosely, through forgiving accessors, so a new server field never crashes an older app. ## Release signing Local release builds use `keystore.properties` if it exists, and the debug key otherwise: ```properties # mobile/android/keystore.properties (git-ignored) storeFile=release.jks storePassword=… keyAlias=namma keyPassword=… ``` Create the keystore once and keep it safe. Updates must be signed with the same key: ```bash keytool -genkeypair -v -keystore release.jks -alias namma -keyalg RSA -keysize 4096 -validity 10000 ``` For GitHub releases, add these repository secrets. The release workflow signs the APK it attaches to each release with them: | Secret | Value | |---|---| | `ANDROID_KEYSTORE_BASE64` | `base64 -w0 release.jks` | | `ANDROID_KEYSTORE_PASSWORD` | store password | | `ANDROID_KEY_ALIAS` | e.g. `namma` | | `ANDROID_KEY_PASSWORD` | key password | The version comes from `namma_agent/version.py`: `2.4.0` becomes versionName `2.4.0`, versionCode `20400`.