This repository contains Android sample code demonstrating the usage of AppFunctions to provide application functionality to system services and agents.
This repository contains two primary projects. An API sample and a testing agent.
The ChatApp sample showcases how a communication app can provide its core features to the Android intelligence system. It serves as an educational reference for implementing AppFunctions.
It is a functional chat application built with Jetpack Compose and Hilt, demonstrating AppFunctions usage across both mobile and Wear OS form factors.
- Location: ChatApp
- Structure:
- app: Main mobile chat application.
- wear: Wear OS companion chat application.
- shared: Common data repositories, ViewModels, and AppFunction service definitions.
- Features: Sending messages, searching contacts, and initiating calls via AppFunctions.
2. AppFunctions Testing Agent
The AppFunctions Testing Agent is a testing and debugging tool for Android AppFunctions. It is designed to help developers verify their integrations, troubleshoot execution issues, and evaluate AppFunctions using both manual deterministic inputs and an LLM-based agent.
- Location: agent
- Documentation: See the Agent README for full building, running, and testing instructions.
- Features: Privileged AppFunction execution, manual debugging, test automation, and LLM agent evaluations.
Follow these steps to explore and run the samples:
- Prerequisites:
- Android Studio.
- Android SDK 36+.
- A device or emulator running Android 16 (API 36) or higher.
- Clone the Repository:
git clone https://github.com/android/appfunctions.git
- Open in Android Studio:
- Open Android Studio and select Open.
- Navigate to the specific project directory (e.g., ChatApp or agent) and click OK.
- Sync and Build: Wait for the Gradle sync to complete and build the project (Build > Make Project).
- Run: For ChatApp, click Run > Run 'app' to deploy the mobile sample to your phone/emulator, or Run > Run 'wear' to deploy the companion app to a Wear OS device/emulator. For agent, refer to the Agent README for privileged launch instructions (./run_privileged.sh).
We'd love to accept your patches and contributions!
- Contributor License Agreement (CLA): All contributors must sign the Google CLA.
- Code Style: We use Spotless to maintain consistent formatting. Run ./gradlew spotlessApply before committing.
- Testing: Ensure all new functionality is covered by unit or instrumentation tests.
- Reviews: All submissions are reviewed via GitHub Pull Requests.
See CONTRIBUTING.md for more detailed information.
License: Apache 2.0. See LICENSE for details.