Google's AppFunctions is a new Jetpack alpha library that lets Android apps expose methods as callable tools for AI agents like Gemini — essentially an on-device equivalent of the Model Context Protocol (MCP). By annotating Kotlin methods with @AppFunction, the OS indexes them at install time so any authorized agent can discover and invoke them without the app being in the foreground. The walkthrough covers adding Gradle dependencies, manifest setup, writing the annotated function with KDoc that becomes runtime metadata for the LLM, registering a factory in the Application class, and testing via adb on Android 16. Key insight: KDoc quality directly affects agent behavior since it becomes the function's contract for the model.
Table of contents
Step 6 — Tell the OS how to build your AppFunction classStep 7 — Test it (adb, a real agent, or both)Other paths (I have not tried yet)Sort: