Google has published a technical guide showing how Android apps can offload complex, multi-step AI agents to a self-hosted cloud backend. The approach uses the Agent Development Kit (ADK) alongside the AG-UI and A2UI protocols to keep the mobile client in sync with long-running workflows, such as booking flights, hotels, and restaurant reservations, without blocking the device session.
Why move agents to the cloud?
According to the source, single-device execution becomes impractical for tasks that span multiple steps and external APIs. A phone session can be interrupted, and managing credentials, state, and tool orchestration on a mobile client introduces complexity. The proposed architecture runs the booking agents in a backend service while the Android app connects to the active session, visualizes progress, and requests user input only when necessary.
Backend orchestration with ADK
The guide defines a Python-based flight booking agent using the Google ADK. The agent is instantiated with a model identifier, natural language instructions, and function tools for searching and reserving flights. The InMemoryRunner manages execution steps, tracks conversation context, and routes messages between the user and the model. Tool calls are executed automatically when the model requests them, allowing developers to focus on procedural logic rather than orchestration.
Streaming updates via AG-UI
To bridge the backend agent and the Android client, the server streams updates using the AG-UI protocol. This bidirectional transport layer standardizes message types for lifecycle events, text messages, tool calls, and state management. On Android, a Kotlin SDK listens to the Server-Sent Events stream and maps the payloads into type-safe client events, enabling a responsive chat-like interface.
Dynamic UI with A2UI
The source introduces the A2UI protocol to render interactive components dynamically. The server sends JSON payloads specifying component layouts and properties, such as option pickers or seat selection grids. The Android client maintains a catalog of supported components, and the A2uiSchemaManager compiles these JSON schemas into system prompts so the model learns the exact structure required. On the device, the A2uiMessageProcessor updates active surfaces, and the A2uiSurface composable renders them reactively within Jetpack Compose.
Dependencies and catalog alignment
The guide lists specific Gradle dependencies for the A2UI model, runtime, and UI libraries, all at version 1.0.0-alpha01. It emphasizes that the backend and mobile client must share the same catalog definition ID. Any change to the backend catalog requires a version bump and a matching update to the Kotlin component class to prevent parsing errors. Standard Material 3 components are available through material3-a2ui without custom implementation.
AI-generated editorial illustration; not a documentary photograph.
Source: Build intelligent Android apps: In-app agentic workflows

Leave a Reply