App Actions let users launch specific features in your app using Google Assistant. By enabling App Actions to extend your app, users can easily deep link into your app using Assistant by simply speaking a request. If the user has your app already installed, Assistant triggers deep linking when users say an invocation phrase that includes your app name, such as "Hey Google, order pizza from ExamplePizzeria."
To enable App Actions, you add an
actions.xml file to your
Android app project that tells Google what built-in intents (BIIs)
your app supports. For some use cases, you can also build Android Slices
and associate them in your
App Actions are supported on Android 5 (API level 21) and higher. Users can only access App Actions on Android phones. Assistant on Android Go does not support App Actions.
App Actions work best for extending your Android app's functionality to Google Assistant, as in the following use cases.
- Deep link into app functionality from Assistant: Connect your existing deep links to user queries matching predefined patterns.
- Display information from your app directly in Assistant: Provide users with inline answers and simple confirmations without changing context.
How App Actions work
From a user's perspective, App Actions behave like shortcuts to parts of your
Android app. When a user invokes an App Action, Assistant matches their
request to a registered BII and its corresponding fulfillment. This
match is based on information you provide in the app's
When a user's query matches the predefined pattern of a BII,
Assistant extracts query parameters into schema.org entities
and generates an Android deep link URL using the mappings found
Actions on Google then uses the deep link URL, prefilled with user-supplied parameters, to take the user directly to specific content in your Android app without additional conversational dialogue. For BIIs using an Android Slice fulfillment, Assistant instead responds to the user directly with the requested information.
For example, a user invokes an App Action with "Hey Google, order a ride to SFO
with ExampleRideshareApp." Assistant matches the user query to the
actions.intent.CREATE_TAXI_RESERVATION BII, and extracts
an intent parameter matching a
schema.org entity specified in
Assistant passes the intent parameter to the defined fulfillment for that
BII, and then deep links the user into the app with
App Actions use Android deep links that you previously implemented in your app to fast-forward users into your app from Assistant. For App Actions, we also recommend you support deep linking with App links, which digitally associates HTTP/HTTPS URLs with apps and websites you own.
Build App Actions
App Actions build on top of existing functionality in your Android app. The process is similar for each App Action you implement. App Actions take users directly to specific content in your app by using Android deep link URLs, which you specify using intent filters in the Android app manifest.
When you build an App Action, the first step is to identify the activity you want to let users access from Assistant. Then, using that information, find the closest matching BII from the App Actions BII reference.
BIIs model some of the common ways that users express tasks they want to do using an app or information they seek. For example, BIIs exist for actions like ordering a meal, booking a ride, and checking an account balance.
Once you identify the in-app functionality and BII to implement, you create an
actions.xml resource in your Android app that maps the BII to your app
functionality. App Actions defined in
actions.xml describe how each BII
resolves its fulfillment as well as which parameters are extracted and provided
to your app.
A significant portion of developing App Actions is mapping BII
parameters to parameters in your defined fulfillment. This process commonly
takes the form of considering
schema.org entities as they relate to your in-app
functionality or creating an inventory of identifiers for your BII.
Test App Actions
During development and testing, use the App Actions test tool to create a preview of your App Actions in Assistant for your Google account. The App Actions test tool is an Android Studio plugin that helps you test how your App Action handles various parameters prior to submitting it for deployment. Once you generate a preview of your App Action in the test tool, you can trigger an App Action on your test device directly from the test tool window.
Follow the Extend an Android app to Google Assistant with App Actions codelab to try building an App Action using our sample Android app.
Then, you can continue on to our guides to build App Actions for your own app. You can also explore these additional resources for building App Actions:
- Download and explore our sample fitness Android app on GitHub.
- Check out r/GoogleAssistantDev: the official Reddit community for developers working with Google Assistant.
- Get support by posting your technical questions to Stack Overflow.
- Report bugs and general issues with App Actions features in our public issue tracker.