Brifing

Building Autonomous Agentic Workflows for Android Apps

Cloud-hosted agents enable complex multi-step workflows with dynamic UI rendering

Android Developers Blog3 min

1Cloud-based agentic workflows

Android apps can offload complex multi-step processes like travel booking to cloud-hosted autonomous agents. These agents persist execution state even when the mobile app closes or loses connectivity. The system coordinates specialized subagents for flights, hotels, and activities while maintaining session continuity. This architecture solves mobile limitations for long-running workflows requiring multiple API calls and user confirmations.

2Agent Development Kit advantages

Google's ADK framework handles agent orchestration automatically, managing conversation context, tool execution, and message routing. Developers define agents with Python functions for database queries and bookings while ADK handles the execution pipeline. The framework supports multiple languages but currently offers A2UI integration only in Python. ADK's InMemoryRunner tracks session state without requiring custom REST endpoints or complex WebSocket implementations.

3AG-UI protocol standardization

The Agent-User Interaction protocol establishes a bidirectional channel between cloud agents and Android clients. It standardizes message types for lifecycle events, text content, tool calls, and state management. On Android, the Kotlin SDK maps these Server-Sent Events to type-safe client events. This enables real-time updates while maintaining clean separation between agent logic and UI presentation layers.

4Dynamic UI with A2UI

The Agent-to-User Interface protocol allows backend agents to describe interactive components dynamically. Agents send JSON payloads specifying UI elements like option pickers and seat selectors, while clients render them natively. This eliminates client-server coupling - new features require only backend updates. The A2uiSchemaManager compiles component schemas into system prompts, ensuring models generate valid UI descriptions.

5Jetpack Compose integration

Android's A2UI Renderer library maps JSON component definitions to Jetpack Compose UI. Developers register custom components like BookingStatus in catalogs matching backend definitions. The material3-a2ui package provides pre-built Material 3 components. A2uiSurface handles reactive state, loading indicators, and animated transitions automatically. Catalog versioning ensures backend and client compatibility.

6Multi-agent coordination example

A travel booking scenario demonstrates the system: The Android app sends itinerary data to a coordinator agent. This agent triggers specialized subagents for flights, hotels, and activities. Subagents push results to a shared session queue streamed back to the app. The coordinator handles dependencies between bookings while maintaining overall workflow state. Users see unified progress across all reservation types.

7Python agent implementation

Developers define agents with custom tools as Python classes. A flight booking agent might include search_flights and reserve_flight tools. ADK automatically invokes these when the model requests them. The framework manages tool confirmation requirements and execution context. Agents run with InMemoryRunner which maintains conversation history and tool outputs for the session duration.

8Real-world UI challenges solved

Traditional chatbot interfaces require custom parsing for each new feature. A2UI's component catalog approach lets backend agents describe new UIs without client updates. The protocol supports complex interactions like seat selection grids that would require custom implementations in chat-based systems. Versioned catalogs prevent breaking changes while allowing UI evolution.

9Development workflow benefits

This architecture separates concerns effectively: Backend developers focus on agent logic and workflow design. Mobile developers implement UI components once in Compose. Product teams can iterate on workflows without app store updates. The system scales to handle numerous specialized agents while presenting a unified experience through standardized protocols.

10Future of agentic apps

Cloud-hosted agentic workflows represent a paradigm shift for mobile development. They enable complex processes previously impractical on devices while maintaining native UI responsiveness. As frameworks like ADK mature, expect more apps to combine local interactivity with cloud-based intelligence. This approach particularly benefits verticals requiring multi-step coordination like travel, healthcare, and financial services.

Original article: Android Developers Blog — Building Autonomous Agentic Workflows for Android Apps