As mobile developers increasingly look to build smarter, context-aware software, managing complex tasks that span multiple sessions on a single device has presented a persistent engineering bottleneck. In the latest installment of the "Build intelligent Android apps" series, Google Senior Developer Relations Engineer Jolanda Verhoef has detailed how developers can leverage custom self-hosted backends, the Agent Development Kit (ADK), and specialized communication protocols to orchestrate autonomous in-app agentic workflows running in the cloud. The approach is designed to solve a fundamental limitation of mobile computing: certain tasks are simply too complex or long-running for a single device session. For instance, booking a comprehensive holiday itinerary requires a complex sequence of coordinating flight schedules, selecting hotel rooms, reserving museum tickets, and scheduling restaurant reservations. Attempting to execute such a multi-step process directly on a mobile device introduces significant friction. If a user accidentally closes the application, active progress can be lost. Furthermore, managing multiple backend steps, maintaining persistent connections, and securely handling API credentials directly on a smartphone quickly complicates application architecture. Read Also: Google Play Enhances Ecosystem Defenses and Review Standards for Generative AI Apps to Combat Harmful Content Android 17 Introduces Strict Per-App Memory Limits to Protect System Performance Across Ecosystem To address these challenges, Google highlights a hybrid model where a custom self-hosted backend executes booking agents in the background. Meanwhile, the Android application connects to the active session, visualizes real-time progress, and prompts the user for input only when critical decisions or authorizations are required. To demonstrate this capability in practice, Google integrated a comprehensive Booking Assistant into "Jetpacker," an open-source sample application designed to showcase advanced artificial intelligence integrations on Android. The Booking Assistant coordinates complex travel reservations across flights, hotels, museums, and dining options. The orchestration of this multi-agent system relies heavily on a trio of core technologies: the Agent Development Kit for managing backend agents, the Agent-User Interaction protocol for real-time messaging, and the Agent-to-User Interface protocol for rendering dynamic layouts natively via Jetpack Compose. Powering Complex Workflows with ADK Agents Rather than forcing developers to manually coordinate orchestration flows using custom REST endpoints or complex web sockets, the Agent Development Kit simplifies the creation and management of intelligent agents. Using ADK, developers can define specialized agents and equip them with custom functions—such as Python tools—to query external databases and execute transactional bookings. In this architecture, an Android application transmits current trip itinerary data to a server. A coordinator agent then evaluates the input and decides which specialized subagents to trigger. Each subagent processes its assigned task and routes its results to a shared session queue, which streams updates back to the mobile client. Behind the scenes, ADK abstracts much of the operational complexity. The framework automatically tracks conversation context, routes messages securely between the user and the underlying large language model, and executes registered tools whenever the model requests them. This enables developers to focus on writing clean procedural logic while the underlying framework manages state and orchestration in the background. Standardizing Agent-Client Communication with AG-UI Running autonomous agents in the cloud while rendering user interfaces seamlessly on Android requires a standardized, bidirectional communication channel. To achieve this, the architecture utilizes the AG-UI protocol, a transport layer protocol designed to standardize message types between backend agents and frontend user interface clients. The AG-UI protocol allows the backend agent to inform the mobile client of lifecycle events, text messages, tool calls, and state management updates. Conversely, the mobile client can send user text messages, tool execution results, and custom action events back to the agent. On the server side, updates are yielded as standard Server-Sent Events, while the Android Kotlin client SDK listens to the active data stream and automatically maps payloads into type-safe client events. This standardized messaging layer moves beyond traditional, rigid chatbot interfaces, laying the groundwork for more advanced, context-aware interactions where the client and server remain perfectly synchronized throughout long-running tasks. Letting the Agent Speak UI with A2UI Traditional chatbots typically return plain text or custom JSON payloads that require client applications to manually parse data and map it to pre-built screens. This creates a tight coupling between the backend and frontend: every time a developer introduces a new feature, modifies a layout, or supports a novel user interaction, they are forced to update both the backend agent and the mobile application simultaneously. Consequently, teams must publish a new application update to app stores and wait for users to install it before changes can take effect. To eliminate this dependency, Google incorporates the A2UI protocol. A2UI empowers cloud-hosted agents to dynamically describe the user interface components that should be rendered on the client device. The mobile application declares a catalog of supported components, and the server transmits a concise JSON payload specifying the exact component layout, hierarchy, and active properties. By decoupling the client’s visual implementation details from the agent’s workflow state, backend models can adjust the interface presented to the user on the fly without requiring client-side binary updates. Designing the Backend UI Schema For a cloud agent to generate accurate A2UI JSON payloads, it must possess precise knowledge of which user interface components are available and what properties they accept. Google addresses this requirement through the ADK A2UI integration. Instead of manually writing verbose prompt instructions for every individual component in an application’s catalog, developers can use a schema manager to compile JSON schemas and layout instructions directly into the system prompt of the language model. This automated compilation ensures that the model learns the exact structural formatting rules required to generate valid A2UI payloads that the client application can safely parse and render. Grounded in this schema layout, the large language model formulates component updates tailored precisely to the capabilities of the Android client, bridging the gap between abstract backend reasoning and concrete frontend presentation. Natively Rendering A2UI with Jetpack Compose To render these dynamic component trees natively on Android devices, developers can integrate the Jetpack Compose A2UI Renderer library. By adding the necessary dependencies to an Android module’s build configuration, applications gain access to specialized models, runtimes, and Material 3 design integrations. Each component class defined within the catalog maps the properties received from incoming JSON payloads directly into Jetpack Compose composable functions. For standard use cases involving common elements such as text, cards, buttons, rows, columns, checkboxes, and date-time pickers, the Material 3 A2UI package provides ready-to-use implementations out of the box, minimizing the need for custom boilerplate code. For specialized flows, developers can register custom components tailored to specific application requirements, such as interactive option pickers, seat selection grids, or booking status trackers. To maintain alignment between the backend and mobile client, both systems rely on a shared catalog definition identifier. If properties are modified or added within the backend catalog, developers must increment the version number and update the corresponding Kotlin component class to prevent parsing errors. Within the application’s view model, A2UI messages are processed using a dedicated message processor that exposes active surface models as state flows. The user interface layer then collects these active surfaces and renders them using official composable functions. The renderer automatically manages reactive component state observation, loading indicators, error fallbacks, and animated transitions between updates, resulting in a fluid user experience. By combining cloud-hosted agent workflows with the AG-UI and A2UI protocols, developers can construct dynamic, native Android interfaces driven directly by advanced artificial intelligence models. While AG-UI establishes a real-time bidirectional streaming channel for messaging and lifecycle events, A2UI enables cloud agents to dynamically describe interactive components, keeping client applications decoupled from complex backend orchestration logic. The complete source code for the Jetpacker sample application is available on GitHub, providing developers with a reference implementation for integrating end-to-end agentic workflows into modern Android applications. Post navigation Android XR SDK Reaches Major Milestone as Core Libraries Hit Beta