Android Developers Blog
Follow
Build intelligent Android apps: In-app agentic workflows
This article details building intelligent Android apps by creating autonomous, agentic workflows in the cloud. For complex tasks exceeding a single device session, a self-hosted backend executes agents in the background, preserving progress and simplifying credential management. Cloud-hosted agents offer advantages like uninterrupted background execution, sophisticated multi-agent orchestration, and adaptable client UIs. The Jetpacker app's Booking Assistant exemplifies this, coordinating various reservations using the Agent Development Kit (ADK).ADK enables defining agents with Python function tools for database interaction and bookings, streamlining orchestration. The Android app sends itinerary data, the coordinator agent triggers subagents, and results stream back via a session queue. Communication between agents and the Android app is standardized by the AG-UI protocol, handling lifecycle events and message types. A2UI further enhances this by allowing agents to dynamically describe UI components.This dynamic UI rendering avoids app updates for layout changes. The backend sends JSON payloads describing components, which the client interprets. The ADK A2UI integration compiles component schemas into system prompts, guiding the LLM to generate valid A2UI payloads. On Android, the Jetpack Compose A2UI Renderer library natively renders these components based on registered catalog definitions. The booking assistant's specific components are implemented, and the A2uiMessageProcessor handles A2UI messages.