Android Developers Blog
Follow
Build intelligent Android apps: Integrate into Android's intelligence system using AppFunctions
This article discusses how to integrate app features into the Android intelligence system using AppFunctions, enhancing user experience with background, agent-driven actions. Traditional UIs are complemented by AppFunctions, which allow privileged agents on the device to access app features without user intervention. The authors adapted their travel planning app, JetPacker, by exposing key functionalities like expense tracking, itinerary management, and voice note capturing as AppFunctions. They identified tasks where voice or text commands are faster than manual UI interactions. For instance, logging an expense or asking about the next itinerary item can be done instantly in the background. Hands-free note capturing is also simplified, allowing users to dictate notes. The system operates on Android MCP, where the app acts as a local server exposing features via AppFunctions. These functions are compiled into sandboxed tool definitions discoverable by the agent. Development was accelerated using the AppFunctions development skill, which assists with data modeling, code generation, and testing. Custom data types are annotated with @AppFunctionSerializable, and features are exposed using @AppFunction. KDoc comments are crucial for LLM understanding of parameters and execution accuracy. Service entry points are created by extending AppFunctionService and annotated with @AppFunctionServiceEntryPoint. Verification of AppFunctions can be done through ADB commands or the AppFunctions Testing Agent. AppFunctions enable a new interaction model for apps, allowing agents to access features securely, with apps maintaining control over private data.