{"id":8050,"date":"2026-09-28T22:11:47","date_gmt":"2026-09-28T22:11:47","guid":{"rendered":"https:\/\/lockitsoft.com\/?p=8050"},"modified":"2026-09-28T22:11:47","modified_gmt":"2026-09-28T22:11:47","slug":"building-autonomous-in-app-agentic-workflows-in-android-with-cloud-hosted-ai-architectures-and-dynamic-uis","status":"publish","type":"post","link":"https:\/\/lockitsoft.com\/?p=8050","title":{"rendered":"Building Autonomous In-App Agentic Workflows in Android with Cloud-Hosted AI Architectures and Dynamic UIs"},"content":{"rendered":"<p>Mobile application development is undergoing a fundamental paradigm shift, moving away from rigid, pre-compiled user interfaces toward fluid, agent-driven experiences. As artificial intelligence models evolve from conversational text generators into autonomous digital assistants capable of executing complex multi-step workflows, the architectural requirements for mobile apps are changing. Complex tasks\u2014such as orchestrating comprehensive travel itineraries, coordinating multi-modal logistics, or executing financial transactions\u2014often exceed the computational bounds, battery constraints, and session stability of a single mobile device session. To address these engineering challenges, Google\u2019s Android Developer Relations team, through Senior Developer Relations Engineer Jolanda Verhoef, has released a comprehensive technical blueprint detailing how developers can build autonomous in-app agentic workflows running in the cloud while natively rendering dynamic interfaces via Jetpack Compose.<\/p>\n<p>This advancement is part of the ongoing blog series titled Build Intelligent Android apps, which demonstrates how to transform basic mobile applications into personalized, intelligent, and agentic experiences. Building upon previous installations that explored on-device inference using Gemini Nano, cloud-hybrid reasoning, and system integrations via AppFunctions, the latest installment introduces the Agent Development Kit (ADK), alongside the Agent-User Interaction (AG-UI) protocol and the Agent-to-User Interface (A2UI) protocol. Together, these technologies establish a robust framework for decoupling cloud-orchestrated reasoning from client-side UI rendering.<\/p>\n<p>The Engineering Challenge of Long-Running Mobile Workflows<\/p>\n<p>Historically, executing multi-step tasks natively on mobile operating systems presented severe architectural limitations. When a user initiates a complex sequence\u2014such as booking an itinerary that encompasses flight coordination, hotel selection, museum reservations, and restaurant bookings\u2014the process requires continuous network calls, secure API credential management, and persistent session state maintenance. If a user accidentally closes the application, switches context to another memory-intensive app, or experiences a transient network drop, mobile operating systems frequently terminate background processes to conserve battery and memory. This often results in a lost session, corrupted transaction states, and a frustrating user experience.<\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhpYNWhjTRYuGX2C-P6Og2DjBVigoK6Vb2bqRy90_7JiTYZzzpHwmncA1f-A5t_KwuiK8UTAn3ilbSAUOF82oZyKFmA6xL6Xd2bOsbonI5IgAws-igxFhSk1clu-snV0jKL4o8uSa5Kx2VnLNDnhgD8IdSLAFtIQv6ILSPAVBj1tQtCB6n-4GzwCztAcSM\/s2469\/0817%20Booking%20assistant%20agentic%20cloud_Meta.png\" alt=\"Build intelligent Android apps: In-app agentic workflows\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<p>Furthermore, managing complex API credentials securely on a client device introduces security vulnerabilities. Storing proprietary enterprise tokens or user authentication keys locally exposes them to potential extraction via reverse engineering. Moving the orchestration layer to a secure, custom self-hosted backend mitigates these risks. In this hybrid architecture, the backend executes specialized booking agents in the background, while the Android application merely connects to the active session to visualize real-time progress and prompt the user for confirmation only when explicit authorization is required.<\/p>\n<p>Orchestrating Multi-Agent Systems with the Agent Development Kit (ADK)<\/p>\n<p>To simplify the complexity of orchestrating multi-agent systems without manually writing custom REST endpoints or managing fragile web socket connections, developers can leverage the Agent Development Kit (ADK). The ADK empowers developers to define specialized software agents equipped with functional tools capable of querying remote databases and executing transactional business logic.<\/p>\n<p>Within the reference application known as Jetpacker\u2014an open-source sample architecture provided by the Android development team\u2014a specialized Booking Assistant coordinates flights, lodgings, cultural events, and dining reservations. The architecture utilizes a coordinator agent that analyzes incoming user intent and dynamically determines which subagents to trigger. For example, a flight booking subagent can be instantiated using lightweight model variants, such as Gemini-3.1-flash-lite, paired with registered function tools that interface with external APIs or mock databases.<\/p>\n<pre><code class=\"language-python\">from google.adk import Agent\nfrom google.adk.runners import InMemoryRunner\nfrom google.adk.tools import FunctionTool\n\ndef search_flights(destination: str, date: str) -&gt; list[str]:\n    return [\"10:00 AM\", \"2:00 PM\"]\n\ndef reserve_flight(flight_time: str) -&gt; str:\n    return \"Reserved flight at \" + flight_time\n\nflight_agent = Agent(\n    name=\"Flight Booker\",\n    model=\"gemini-3.1-flash-lite\",\n    instruction=\"Help the user search for flights and book a reservation.\",\n    tools=[\n        FunctionTool(search_flights),\n        FunctionTool(reserve_flight, require_confirmation=True)\n    ]\n)\n\nrunner = InMemoryRunner(flight_agent)<\/code><\/pre>\n<p>By utilizing the ADK runtime, developers are relieved from manually writing boilerplate code to track conversation contexts, route messages between the user and the neural model, or handle tool-calling loops. The framework automatically manages these execution steps, allowing engineers to focus entirely on procedural business logic while background orchestration handles the heavy lifting.<\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjNa-v7A2ABn7qHN9E-obrjwyUAuku-TvoFIU6mLjHxZ2zwZuS2VN13fXueh7yS9yY6dk8eupV_aMgbuhG2QpyRgvktuag6nPYw21suWq-tGEveeP3V9jYrowOsFrcLws3egM9Ozi-FYhyphenhyphenuesH60KrapEKxngThe7Sf1tTpAyi3ToqlsP1Jwrf7z0UhZ44\/w215-h400\/Screenshot%202026-09-24%20at%2011.09.35%E2%80%AFAM.png\" alt=\"Build intelligent Android apps: In-app agentic workflows\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<p>Standardizing Communication Channels via AG-UI<\/p>\n<p>Bridging a cloud-hosted agentic backend with a mobile client requires a standardized, bidirectional transport layer capable of handling real-time data streams, lifecycle events, text messages, tool execution logs, and state synchronization. To solve this interoperability challenge, developers utilize the AG-UI protocol.<\/p>\n<p>AG-UI functions as a standardized message-type protocol designed explicitly for communication between intelligent agents and UI-driven client applications. On the server side, updates are yielded as standard Server-Sent Events (SSE), containing JSON deltas for text generation, tool invocations, and state updates. On the client side, the Android application utilizes a Kotlin SDK that listens to this incoming stream and maps the payloads into strongly-typed client events.<\/p>\n<pre><code class=\"language-kotlin\">val config = HttpAgentConfig(\n    agentId = \"booking-assistant\",\n    threadId = threadId,\n    url = \"https:\/\/&lt;your-backend-url&gt;\"\n)\nval agent = HttpAgent(config, httpClient)\n\nval input = RunAgentInput(\n    threadId = threadId,\n    runId = runId,\n    messages = listOf(UserMessage(\"Book a flight to Paris\"))\n)\n\nagent.runAgentObservable(input)\n    .collect  event -&gt;\n        when (event) \n            is TextMessageStartEvent -&gt;  \/* ... *\/ \n            is TextMessageContentEvent -&gt;  \/* ... *\/ \n            is TextMessageEndEvent -&gt;  \/* Handle completion *\/ \n        \n    <\/code><\/pre>\n<p>This streaming architecture allows applications to move beyond traditional, static chatbot interfaces, offering users real-time visibility into the agent&#8217;s internal reasoning and operational milestones.<\/p>\n<p>Decoupling Client and Server Dependencies with A2UI<\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgY6IiKGjUY3WJdlgTOgeHcogIeKdxuziERDbxEtw2vcZ29yB-skCjhxSvhZ8HGDD_TbQ7SDTt1ugXRq1uYaza2FfeTMs9m4dMzcx5rIUrskMDgHqW5QZHvitpQUhQxXMaCF708k7hwrWl9GjFqhHnQ7AZPH5Gpj0b0YqULJJ5sGQ1J0sqVI5kfPn_Pgmc\/s1600\/diagram.png\" alt=\"Build intelligent Android apps: In-app agentic workflows\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<p>Traditional conversational AI architectures rely on static text responses or custom JSON payloads that require the client application to parse proprietary data structures and map them to pre-built screens. This creates a tight architectural coupling: every time an engineering team wishes to introduce a new UI component, modify a layout constraint, or support a novel user interaction, they are forced to update both the backend agent and the mobile application simultaneously. Consequently, businesses must publish an application update to app stores and wait for users to install the latest version\u2014a process that introduces significant friction and deployment latency.<\/p>\n<p>To eliminate this dependency, the development team integrated the A2UI protocol. A2UI enables cloud-hosted agents to dynamically describe the user interface components that should be rendered on the client device. Instead of hardcoding layout definitions within the mobile app, the client declares a catalog of supported UI components, while the server transmits structured JSON payloads specifying component hierarchies, layout properties, and active states.<\/p>\n<pre><code class=\"language-json\">\n  \"version\": \"v0.9\",\n  \"updateComponents\": \n    \"surfaceId\": \"Flight Reservation\",\n    \"components\": [\n      \n        \"id\": \"flight_option_picker\",\n        \"component\": \"InteractiveOptionPicker\",\n        \"properties\": \n          \"prompt\": \"Select a flight time:\",\n          \"options\": [\"10:00 AM\", \"2:00 PM\"],\n          \"selectedIdx\": null,\n          \"confirmBtnText\": \"Confirm Flight\"\n        \n      \n    ]\n  \n<\/code><\/pre>\n<p>By decoupling the client&#8217;s visual implementation details from the agent&#8217;s workflow state, product teams can update workflows, introduce new interactive elements, and refine user experiences entirely on the server side without requiring client-side binary updates.<\/p>\n<p>Grounded Prompt Engineering with A2UI Schema Management<\/p>\n<p>For an autonomous language model to reliably generate valid A2UI JSON payloads that match the client&#8217;s rendering capabilities, it must possess precise contextual awareness of the available component catalog. The ADK A2UI integration solves this by automating schema injection directly into the system prompt.<\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEj9K36QnRp431YcN0t3GZhffLYrhIzePms96XdeuOFguDDTSsX8o6VKwRpULD5l-nJ6jqBKSVZ9Vdu4MZ549I5PM-B-9pWY72zXT53SkRGZVNDkdOEl0zD5PAzqwo5lEOktYIvugUQKtmI9qqs_niZ38LTMWc6YdmD3q_pHWi1YjGGE4EJsMot7yhLQVkI\/s1600\/web_debug.png\" alt=\"Build intelligent Android apps: In-app agentic workflows\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<p>Utilizing the <code>A2uiSchemaManager<\/code>, developers can compile JSON schemas and layout instructions directly from their defined component catalogs. This ensures that the underlying large language model learns the exact structural formatting rules, validation constraints, and property types required to generate compliant A2UI payloads.<\/p>\n<pre><code class=\"language-python\">from a2ui.schema.manager import A2uiSchemaManager\nfrom a2ui.schema.constants import VERSION_0_9\nfrom a2ui.schema.catalog import CatalogConfig\nfrom a2ui.basic_catalog.provider import BasicCatalog\n\nschema_manager = A2uiSchemaManager(\n    version=VERSION_0_9,\n    catalogs=[\n        BasicCatalog.get_config(version=VERSION_0_9),\n        CatalogConfig.from_path(\n            name=\"https:\/\/example.com\/catalogs\/booking_assistant\/v1\/catalog.json\",\n            catalog_path=\"booking_catalog.json\"\n        )\n    ]\n)\n\nA2UI_SYSTEM_INSTRUCTION = schema_manager.generate_system_prompt(\n    role_description=\"You are a helpful travel booking assistant.\",\n    ui_description=\"Use InteractiveOptionPicker for choices...\",\n    include_schema=True,\n    include_examples=True,\n    allowed_components=[\"InteractiveOptionPicker\", \"SeatSelectionPicker\", \"BookingStatus\"]\n)<\/code><\/pre>\n<p>Natively Rendering Dynamic Surfaces via Jetpack Compose<\/p>\n<p>To transform these cloud-generated JSON definitions into fluid, native Android views, developers utilize the newly introduced Jetpack Compose A2UI Renderer library. By incorporating the core runtime and Material 3 integration packages into the application\u2019s Gradle configuration, engineers can map remote component classes directly to native Jetpack Compose composable functions.<\/p>\n<pre><code class=\"language-kotlin\">dependencies \n    implementation(\"androidx.a2ui:a2ui-model:1.0.0-alpha01\")\n    implementation(\"androidx.a2ui.compose:compose-runtime:1.0.0-alpha01\")\n    implementation(\"androidx.a2ui.compose:compose-ui:1.0.0-alpha01\")\n    implementation(\"androidx.compose.material3:material3-a2ui:1.0.0-alpha01\")\n<\/code><\/pre>\n<p>Custom components\u2014such as <code>InteractiveOptionPicker<\/code>, <code>SeatSelectionPicker<\/code>, and <code>BookingStatus<\/code>\u2014are registered within a centralized catalog that mirrors the backend definition. Furthermore, for standard UI patterns, the <code>material3-a2ui<\/code> library provides ready-to-use Material 3 implementations for basic elements including text blocks, cards, buttons, checkboxes, and date-time pickers, minimizing the need for custom layout boilerplate.<\/p>\n<p>Inside the application&#8217;s ViewModel, incoming A2UI messages are processed via the <code>A2uiMessageProcessor<\/code>, exposing active surfaces as reactive state flows to the UI layer:<\/p>\n<figure class=\"article-inline-figure\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgDYF-5x9o0qJV89ryt5EEoHZ2D7gGalaWmFcj1V9ZUqHGRNZ2Qe3iGwr1NUgq4L-PW-PK2rH8cQQXdrAgsmbqDQajlb33IS97njpAtHS5cLLwSj7xklY1MizbJNasLicgFjQlI_NpG76xWML1Zi0Rr7eMPRYyYX65V2Y7iQgv4bG2gsRNvBHhtB8iaAPM\/w191-h400\/manage_bookings_coorect.png\" alt=\"Build intelligent Android apps: In-app agentic workflows\" class=\"article-inline-img\" loading=\"lazy\" \/><\/figure>\n<pre><code class=\"language-kotlin\">class BookingAssistantViewModel : ViewModel() \n    private val messageProcessor = A2uiMessageProcessor(\n        catalogs = listOf(bookingAssistantCatalog())\n    )\n    val activeSurfaces: StateFlow&lt;List&lt;A2uiSurfaceModel&gt;&gt; = messageProcessor.activeSurfaces\n\n    init \n        viewModelScope.launch(Dispatchers.Default)  \n            messageProcessor.collectMessages() \n        \n    \n<\/code><\/pre>\n<p>Finally, within the Jetpack Compose screen, these active surfaces are collected and rendered using the official <code>A2uiSurface<\/code> composable. The framework automatically manages reactive state observation, Material 3 loading indicators, error fallbacks, and animated transitions between updates.<\/p>\n<pre><code class=\"language-kotlin\">@Composable\nfun BookingAssistantScreen(\n    viewModel: BookingAssistantViewModel,\n    modifier: Modifier = Modifier\n) \n    val activeSurfaces by viewModel.activeSurfaces.collectAsState()\n    LazyColumn(\n        modifier = modifier.fillMaxWidth(),\n        verticalArrangement = Arrangement.spacedBy(16.dp)\n    ) \n        items(activeSurfaces)  surfaceModel -&gt;\n            Card(modifier = Modifier.fillMaxWidth()) \n                A2uiSurface(\n                    surfaceModel = surfaceModel,\n                    modifier = Modifier.fillMaxWidth().wrapContentHeight()\n                )\n            \n        \n    \n<\/code><\/pre>\n<p>Implications and Industry Outlook<\/p>\n<p>The convergence of cloud-hosted agentic backends, standardized transport protocols like AG-UI, and dynamic UI rendering frameworks such as A2UI represents a major maturation point for intelligent mobile applications. By separating business logic orchestration from device-level presentation, developers can build resilient, long-running assistant workflows that withstand network interruptions and device state resets. <\/p>\n<p>Industry analysts observe that this architectural pattern significantly reduces time-to-market for AI-driven feature deployments. Because cloud agents dictate interface composition dynamically, enterprises can iterate on user experience flows, introduce transactional capabilities, and optimize booking pipelines in real time without forcing end-users through continuous client-side update cycles.<\/p>\n<p>Developers seeking to examine the complete reference architecture can access the open-source Jetpacker repository on GitHub. As mobile operating systems continue to embrace agentic architectures, the implementation of cloud-hybrid reasoning and dynamic protocol-driven rendering will likely become an industry standard for enterprise-grade mobile engineering.<\/p>\n<!-- RatingBintangAjaib -->","protected":false},"excerpt":{"rendered":"<p>Mobile application development is undergoing a fundamental paradigm shift, moving away from rigid, pre-compiled user interfaces toward fluid, agent-driven experiences. As artificial intelligence models evolve from conversational text generators into autonomous digital assistants capable of executing complex multi-step workflows, the architectural requirements for mobile apps are changing. Complex tasks\u2014such as orchestrating comprehensive travel itineraries, coordinating &hellip;<\/p>\n","protected":false},"author":10,"featured_media":8049,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[292,21,4,905,34,567,72,5,1781,2061,3,1295],"class_list":["post-8050","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mobile-application-development","tag-agentic","tag-android","tag-apps","tag-architectures","tag-autonomous","tag-building","tag-cloud","tag-development","tag-dynamic","tag-hosted","tag-mobile","tag-workflows"],"_links":{"self":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/8050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8050"}],"version-history":[{"count":0,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/8050\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/media\/8049"}],"wp:attachment":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}