# A2UI-Android
**Repository Path**: conanchen/A2UI-Android
## Basic Information
- **Project Name**: A2UI-Android
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-02-18
- **Last Updated**: 2026-03-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# A2UI: Agent-to-User Interface
[](https://opensource.org/licenses/Apache-2.0)
[](https://developer.android.com)
[](https://kotlinlang.org)
[](https://android-arsenal.com/api?level=21)
> π **This is a fork of [google/A2UI](https://github.com/google/A2UI) with a complete Android Jetpack Compose Renderer implementation.**
## π What is A2UI-Android?
**A2UI-Android** is a powerful, production-ready Android rendering engine for the [A2UI Protocol](https://github.com/google/A2UI) that enables your Android apps to dynamically render beautiful, interactive user interfaces generated by AI agents.
Imagine your AI assistant being able to create rich, native Android UIs on-the-fly instead of just text responses - forms with validation, data dashboards, interactive cards, and more. That's what A2UI-Android makes possible!
### π― Why Choose A2UI-Android?
| π€ **AI-Powered UIs** | π **Secure by Design** | β‘ **High Performance** |
|:---:|:---:|:---:|
| Let AI agents generate native Android interfaces dynamically | Declarative JSON format - no arbitrary code execution | Optimized with `rememberSaveable`, lazy rendering, and smart recomposition |
| π¨ **Fully Customizable** | βΏ **Accessible** | π± **Wide Compatibility** |
|:---:|:---:|:---:|
| Dynamic themes, colors, dark mode, custom components | WCAG A compliant with full TalkBack support | Android 5.0+ (API 21) - covers 99%+ of devices |
### β¨ Feature Highlights
- **20+ Ready-to-Use Components**: Text, Button, TextField, Card, List, Modal, Tabs, Slider, DatePicker, and more
- **Smart Data Binding**: Two-way binding with path expressions (`/user/profile/name`)
- **Built-in Validation**: Email, URL, phone, regex, length, required fields - all out of the box
- **Real-time Updates**: WebSocket and SSE transport for live UI updates from agents
- **State Persistence**: Survives configuration changes, process death, and screen rotations
- **Beautiful Animations**: Smooth transitions and modal animations built-in
- **Comprehensive Testing**: 49+ unit tests with 100% core functionality coverage
### π± Supported Components
```
Text β’ Button β’ TextField β’ CheckBox β’ Switch β’ Slider
ChoicePicker β’ Dropdown β’ Card β’ Row β’ Column β’ List
Tabs β’ Modal β’ Image β’ Icon β’ Divider β’ Spacer
ProgressBar β’ DateTimeInput β’ Video β’ AudioPlayer β’ Surface
```
### π Quick Start
```kotlin
@Composable
fun A2UIScreen() {
val renderer = rememberA2UIRenderer()
// Process A2UI message
renderer.processMessage("""
{
"version": "v0.10",
"createSurface": {
"surfaceId": "hello",
"catalogId": "https://a2ui.org/catalog.json"
}
}
""")
// Render UI
A2UISurface(surfaceId = "hello")
}
```
### π¦ Installation
Add the compose module to your project:
```kotlin
// settings.gradle.kts
include(":android_compose")
// build.gradle.kts
dependencies {
implementation(project(":android_compose"))
}
```
### π Full Documentation
See [android_compose/README.md](android_compose/README.md) for complete documentation including:
- Architecture overview
- Component reference
- Theme customization
- Network integration
- Error handling
- Testing guide
---
## π Project Overview
A2UI is an open standard and set of libraries that allows agents to "speak UI." Agents send a declarative JSON format describing the *intent* of the UI. The client application then renders this using its own native component library.
### Why A2UI?
- **Security First**: Declarative data format, not executable code
- **LLM-Friendly**: Flat component list, easy for LLMs to generate incrementally
- **Framework-Agnostic**: Same JSON payload renders on multiple platforms
- **Flexibility**: Open registry pattern for custom components
### Available Renderers
| Platform | Status | Location |
|----------|--------|----------|
| **Android (Compose)** | β
Complete | [android_compose/](android_compose/) |
| **Web (Lit)** | β
Available | renderers/lit/ |
| **Flutter** | β
Available | [GenUI SDK](https://github.com/flutter/genui) |
| **React** | π Planned | - |
| **iOS (SwiftUI)** | π Planned | - |
---
## ποΈ Architecture
```
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β A2UI Agent ββββββΆβ Transport ββββββΆβ Renderer β
β (Backend) β β WebSocket/SSE β β (Compose) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β
β JSON Message β
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β { β
β "version": "v0.10", β
β "createSurface": { "surfaceId": "main", ... }, β
β "updateComponents": { "components": [...] } β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
---
## π Getting Started
### Prerequisites
- Android Studio Hedgehog (2023.1.1) or later
- Android SDK 21+ (Android 5.0 Lollipop)
- Kotlin 1.9.22
- JDK 17
### Running the Android Demo
1. **Clone the repository:**
```bash
git clone https://github.com/lmee/A2UI-Android.git
cd A2UI-Android
```
2. **Open in Android Studio:**
- Open Android Studio
- Select "Open an existing project"
- Navigate to the cloned directory
3. **Run the app:**
- Select a device or emulator
- Click "Run" or press `Shift+F10`
### Running the Web Demo (Original)
For the original web-based demo:
```bash
# Set API key
export GEMINI_API_KEY="your_gemini_api_key"
# Run Agent
cd samples/agent/adk/restaurant_finder
uv run .
# Run Client (new terminal)
cd renderers/web_core && npm install && npm run build
cd ../lit && npm install && npm run build
cd ../../samples/client/lit/shell && npm install && npm run dev
```
---
## π Project Structure
```
A2UI/
βββ android_compose/ # π Android Compose Renderer
β βββ src/main/java/org/a2ui/compose/
β β βββ data/ # Data model & processing
β β βββ rendering/ # Core renderer & components
β β βββ transport/ # Network layer (WebSocket/SSE)
β β βββ theme/ # Theme customization
β β βββ error/ # Error handling
β β βββ example/ # Demo application
β βββ src/test/ # Unit tests (49 tests)
β βββ build.gradle.kts # Build configuration
β βββ README.md # Full documentation
βββ renderers/
β βββ web_core/ # Web core library
β βββ lit/ # Lit renderer
βββ samples/
β βββ agent/ # Agent examples
β βββ client/ # Client examples
βββ docs/ # Documentation
βββ specification/ # A2UI specification
```
---
## π§ Android Compose Features
### Component Example
```kotlin
// Define UI via JSON
val message = """
{
"version": "v0.10",
"updateComponents": {
"surfaceId": "form",
"components": [
{
"id": "email_field",
"component": "TextField",
"label": "Email",
"value": { "path": "/form/email" },
"required": true,
"checks": [
{ "call": "email", "message": "Invalid email format" }
]
},
{
"id": "submit_btn",
"component": "Button",
"text": "Submit",
"action": { "event": { "name": "submit_form" } }
}
]
}
}
"""
```
### Theme Customization
```kotlin
val themeConfig = A2UIThemeConfig(
primaryColor = "#6200EE",
secondaryColor = "#03DAC6",
darkMode = false
)
A2UITheme(config = themeConfig) {
A2UISurface(surfaceId = "main")
}
```
---
## β οΈ Status: Early Stage Public Preview
> **Note:** A2UI is currently in **v0.10 (Public Preview)**. The specification and implementations are functional but are still evolving.
---
## πΊοΈ Roadmap
- [x] Android Compose Renderer (Complete)
- [ ] React Renderer
- [ ] iOS SwiftUI Renderer
- [ ] REST Transport Support
- [ ] Additional Agent Frameworks (Genkit, LangGraph)
---
## π€ Contributing
A2UI is an **Apache 2.0** licensed project. We welcome contributions!
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
### Development Setup
```bash
# Clone and setup
git clone https://github.com/lmee/A2UI-Android.git
cd A2UI-Android
# Run tests
./gradlew :android_compose:test
# Build
./gradlew :android_compose:build
```
---
## π License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
---
## π Links
- **Android Compose Renderer**: [android_compose/README.md](android_compose/README.md)
- **A2UI Specification**: [specification/](specification/)
- **GenUI SDK (Flutter)**: https://github.com/flutter/genui
- **CopilotKit Widget Builder**: https://go.copilotkit.ai/A2UI-widget-builder
---
**Maintained by the A2UI Community**