{"slug": "build-intelligent-android-apps-integrate-into-android-s-intelligence-system", "title": "Build intelligent Android apps: Integrate into Android's intelligence system using AppFunctions", "summary": "Google announced that Android apps can integrate with the platform's intelligence system using AppFunctions, enabling voice and text commands to perform tasks like expense tracking, itinerary management, and note capturing faster than manual UI navigation. Ben Weiss, Senior Developer Relations Engineer at Android Developer Relations, detailed how the travel planning app JetPacker exposes features such as addExpense and getItinerary as AppFunctions, allowing system agents to execute them in the background. The Android MCP model treats apps as local MCP servers, with the platform as a central tool registry, giving developers control over which features are accessible to agents.", "body_md": "*Posted by Ben Weiss, Senior Developer Relations Engineer, Android Developer Relations*\n\nWelcome back to the blog post series \"[Build intelligent Android apps](http://android-developers.googleblog.com/2026/07/build-intelligent-android-apps-introduction-jetpack.html)\" where we take a basic Android app and transform it into a personalized, intelligent, and agentic experience. In our [previous post](http://android-developers.googleblog.com/2026/07/build-intelligent-android-apps-cloud-hybrid-inference.html), we explored how to leverage Firebase AI Logic to build cloud-hosted and hybrid AI features.\n\nIn this article, we'll show you how we designed and integrated these capabilities into our travel planning app, [JetPacker](https://github.com/android/jetpacker), using Android AppFunctions. We'll explore the rationale behind our feature choices, discuss the specialized tooling we used to accelerate development, and dive into the code that makes it all work.\n\nTo select which features to provide to the intelligence system, we looked for tasks where a voice or text command is objectively faster than tapping through screens. In this side-by-side screen recording you can see this contrast perfectly: on the left, a user tapping through multiple screens to log an expense; on the right, the same task completed instantly in the background via a privileged agent.\n\nOur first choice was expense tracking. Logging a coffee expense during a trip usually takes quite a few taps—unlocking the phone, opening the app, finding the active trip, navigating to the expenses tab, tapping the add button, taking a picture of the receipt, and checking the result. By providing the `addExpense`\n\nand `getExpenses`\n\nfeatures as AppFunctions, the system agent handles the heavy lifting. When the user says, \"Add a five-dollar coffee expense to my Paris trip,\" the agent automatically searches for the correct trip ID in the background and inserts the expense, skipping the manual UI flow entirely.\n\nWe also prioritized itinerary management. Finding what activity is next on a busy trip itinerary usually requires scrolling through a dense timeline view. By providing `getItinerary`\n\nand `addItineraryEvent`\n\nto the system, the user can simply ask, \"What am I doing next in Paris?\" and get an immediate answer.\n\nFinally, we focused on hands-free note capturing. Typing out reminders or notes while walking down a busy street is difficult and unsafe. Exposing a voice note capability allows the user to say, \"The flight was amazing, I saw a beautiful sunset and managed to sleep well,\" and the privileged agent automatically transcribes and saves it directly into the travel database using the addVoiceNote AppFunction.\n\nUnder the Android MCP model, your app acts as a local MCP server that exposes structured tools, while the Android platform serves as the central tool registry. On the MCP client side, agent apps are registered with the intelligence system after being granted system-privileged permissions to access the registry.\n\nWhen a user interacts with a registered agent, its LLM determines if the request can be handled by an AppFunction, queries the platform's metadata, and executes the appropriate registered functions in the background. This local MCP client-server design gives you full control: you choose exactly which features are accessible to the agent, keeping the rest of your app's data private.\n\n`Service`\n\nentry points, refining our `KDoc`\n\ndocumentation to ensure the LLM understands parameter boundaries, and setting up automated testing using ADB.\nEnough with the theory, let's dive into the implementation.\n\nWe begin by adding the AppFunctions dependencies. One for the API and one for the Kotlin Symbol Processing compiler.\n\n```\nimplementation(\"androidx.appfunctions:appfunctions:1.0.0-alpha10\")\nksp(\"androidx.appfunctions:appfunctions-compiler:1.0.0-alpha10\")\n```\n\nAny custom object exchanged with the agent must be annotated with `@AppFunctionSerializable`\n\n. In our [TripSerializable.kt](https://github.com/android/ai-samples/tree/main/jetpacker/android/feature/appfunctions/src/main/java/com/example/jetpacker/feature/appfunctions/TripSerializable.kt) file, we define our trip data model:\n\n```\n@AppFunctionSerializable(isDescribedByKDoc = true)\ndata class TripSerializable(\n    /** The trip's unique identifier. */\n    val id: String,\n    /** The trip's title. */\n    val title: String,\n    /** The trip's destination location. */\n    val location: String,\n    /** The trip's start date in milliseconds. */\n    val startDate: Long,\n    /** The trip's end date in milliseconds. */\n    val endDate: Long,\n    /** A list of participants. */\n    val participants: List<String>,\n)\n```\n\nNext, the skill wrote the Kotlin functions that perform the database queries and annotate them with `@AppFunction`\n\n. We can view this in searchTrip:\n\n```\n/**\n * Looks for trips based on optional filters like id, title (name), location, and dates.\n *\n * @param id The unique identifier of the trip.\n * @param title The title or name of the trip.\n * @param location The destination location.\n * @param startDate The minimum start date in milliseconds.\n * @param endDate The maximum end date in milliseconds.\n * @return A list of trips matching the filters.\n */\n@AppFunction(isDescribedByKDoc = true)\nsuspend fun searchTrip(\n    id: String? = null,\n    title: String? = null,\n    location: String? = null,\n    startDate: Long? = null,\n    endDate: Long? = null\n): List<TripSerializable> {\n    return withContext(Dispatchers.IO) {\n    // implementation\n}\n```\n\nSince AppFunctions run on the UI thread by default, we use `withContext(Dispatchers.IO)`\n\nto switch to a background dispatcher. Additionally, we refine our KDoc to use clear, imperative verbs and specify parameter constraints. This documentation compiles directly into the tool's schema, which the privileged agent uses to resolve parameters and handle runtime errors.\n\nTo register these features with the intelligence system, we create an abstract base class that extends `AppFunctionService`\n\n. We annotate it with `@AppFunctionServiceEntryPoint`\n\n:\n\n```\n@RequiresApi(36)\n@AndroidEntryPoint\n@AppFunctionServiceEntryPoint(\n    serviceName = \"JetPackerAppFunctionService\",\n    appFunctionXmlFileName = \"jetpacker_app_function_service\"\n)\nabstract class BaseJetPackerAppFunctionService : AppFunctionService() {\n    @Inject internal lateinit var tripDao: TripDao\n    // DAOs and database references are injected here...\n}\n```\n\nDuring compilation, KSP generates the final concrete service subclass, `JetPackerAppFunctionService`\n\n, as declared with the `serviceName`\n\nparameter. We also register `app_metadata.xml`\n\nin the app's manifest. This file provides global operational rules for JetPacker's declared AppFunctions.\n\nOnce implemented, you should verify that your AppFunctions are registered and working correctly.\n\nRunning devices or emulators with Android 17 or newer, you can use ADB commands from your terminal to list and invoke your functions. Running `adb shell cmd app_function list-app-functions`\n\ndisplays all registered functions for your package. You can then execute a specific function and test its database integration by running `adb shell cmd app_function execute-app-function`\n\nwhile passing a raw JSON parameters string.\n\nInstead of these ADB commands, you can also use the [AppFunctions Testing Agent](https://github.com/android/appfunctions) to inspect your configuration, list and execute AppFunctions, and even see how your AppFunctions behave in a real conversational flow.\n\nWhen thinking about app features that can be contributed to the intelligence system using AppFunctions requires a slight shift in how we think about code and documentation. AppFunctions enable you to use this new interaction model for apps, which allows using an agent to access app features..\n\nFirst, the [AppFunctions development skill](https://github.com/android/skills/tree/main/device-ai/appfunctions) is an essential lifecycle tool, helping you discover features, implement and refine AppFunctions for your apps. Second, KDoc comments are a compiled API asset; clear parameter descriptions directly impact the execution accuracy of the system agent. Finally, Android MCP provides local-first execution allowing apps to safely collaborate with AI agents.\n\nContributing app features through AppFunctions makes your application ready for the intelligence system. Let us know how you are adapting your apps for the agentic era!\n\nCheck out the other parts of this blog post series:** Part 1:** Introduction of the app and a high-level overview.\n\nInterested in more on Android Development? Follow Android Developers on [YouTube](https://www.youtube.com/@AndroidDevelopers) or [LinkedIn](https://www.linkedin.com/showcase/androiddev/)!\n\nAll code snippets in this blog post follow the following copyright notice:\n\n```\nCopyright 2026 Google LLC.\nSPDX-License-Identifier: Apache-2.0\n```\n\n", "url": "https://wpnews.pro/news/build-intelligent-android-apps-integrate-into-android-s-intelligence-system", "canonical_source": "https://android-developers.googleblog.com/2026/07/build-intelligent-android-apps-appfunctions.html", "published_at": "2026-07-21 13:00:00+00:00", "updated_at": "2026-07-21 17:17:19.077228+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "developer-tools", "large-language-models"], "entities": ["Google", "Android", "Ben Weiss", "JetPacker", "Firebase AI Logic", "AppFunctions", "Android MCP", "Kotlin Symbol Processing"], "alternates": {"html": "https://wpnews.pro/news/build-intelligent-android-apps-integrate-into-android-s-intelligence-system", "markdown": "https://wpnews.pro/news/build-intelligent-android-apps-integrate-into-android-s-intelligence-system.md", "text": "https://wpnews.pro/news/build-intelligent-android-apps-integrate-into-android-s-intelligence-system.txt", "jsonld": "https://wpnews.pro/news/build-intelligent-android-apps-integrate-into-android-s-intelligence-system.jsonld"}}