[ Web Proxy ]
URL:
Viewing: https://developer.android.com/develop/ui/compose/system/shortcuts/adding-capabilities [Back]  [Original]

Add capabilities to shortcuts  |  Jetpack Compose  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]

Add capabilities to shortcuts Stay organized with collections Save and categorize content based on your preferences.

Capabilities in shortcuts.xml let you declare the types of actions users can take to launch your app and directly perform a specific task. A capability consists of the name of the action and an intent targeting the destination in your app that resolves the user intent.

Define capabilities in shortcuts.xml

You define capability elements in a shortcuts.xml resource file in your Android app development project. To define a capability element, do the following:

  1. Create a shortcuts.xml resource by following the instructions in Create static shortcuts.
  2. Include the following required information in your capability:

    • Capability name: the action you want your app to support. Refer to the component documentation for the feature that requires capability definitions.

    • App destination: the destination in your app the action launches to fulfill the user request. Define app destinations using intent elements nested within the capability.

    • Parameter mappings: each intent might contain parameters to be passed as extra data of the intent.

The following example demonstrates a capability definition in shortcuts.xml for actions.intent.START_EXERCISE, a BII that lets users use spoken commands with Assistant to begin a workout in a fitness app:

<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
  <capability android:name="actions.intent.START_EXERCISE">
    <intent
      android:action="android.intent.action.VIEW"
      android:targetPackage="com.example.sampleApp"
      android:targetClass="com.example.sampleApp.ExerciseActivity">
      <parameter
        android:name="exercise.name"
        android:key="exerciseType"/>
    </intent>
  </capability>
</shortcuts>

In the preceding example, the <capability> android:name attribute refers to the START_EXERCISE BII. If a user invokes this BII by asking Assistant, "Hey Google, start a run in ExampleApp," Assistant fulfills the user request using information provided in the nested intent element. The intent in this sample defines the following details:

Associate shortcuts with a capability

Once you define a capability, you can extend its functionality by associating static or dynamic shortcuts with it. How shortcuts are linked to a capability depends on the feature being implemented and the actual words included in a user's request. For example, when a user begins a run in your fitness tracking app by asking Assistant, "Hey Google, start a run in ExampleApp." Assistant can use a shortcut to launch an instance of a capability that defines a valid exercise entity of "run" for the exercise.name parameter.

Create shortcuts
Manage shortcuts

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-14 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-14 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page