1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2014 The Android Open Source Project
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<sample>
18    <name>AppShortcuts</name>
19    <group>System</group>
20    <package>com.example.android.appshortcuts</package>
21
22    <minSdk>25</minSdk>
23
24    <strings>
25        <intro>
26            <![CDATA[
27            This sample demonstrates how to use the Launcher Shortcuts API introduced in API 25.
28            This API allows an application to define a set of Intents which are displayed as
29            when a user long-presses on the app's launcher icon. Examples are given for
30            registering both links both statically in XML, as well as dynamically at runtime.
31            ]]>
32        </intro>
33    </strings>
34
35    <template src="base-build" />
36
37    <metadata>
38        <status>PUBLISHED</status>
39        <categories>System</categories>
40        <technologies>Android</technologies>
41        <languages>Java</languages>
42        <solutions>Mobile</solutions>
43        <level>INTERMEDIATE</level>
44        <icon>screenshots/icon-web.png</icon>
45        <screenshots>
46            <img>screenshots/screenshot-1.png</img>
47        </screenshots>
48        <api_refs>
49            <android>android.content.pm.ShortcutManager</android>
50        </api_refs>
51
52        <description>
53<![CDATA[
54This sample demonstrates how to use the Launcher Shortcuts API introduced in Android 7.1 (API 25).
55This API allows an application to define a set of Intents which are displayed as when a user
56long-presses on the app's launcher icon. Examples are given for registering both links both
57statically in XML, as well as dynamically at runtime.
58]]>
59        </description>
60
61        <intro>
62<![CDATA[
63You can use the shortcuts feature in Android 7.1 (API 25) to bring users from the launcher
64directly to key actions within your app. Users simply long-press your app's launcher icon
65to reveal the app's shortcuts, then tap on a shortcut to jump to the associated action.
66These shortcuts are a great way to engage users, and they let you surface the functionality
67of your app even before users launch your app.
68
69Each shortcut references an intent, each of which launches a specific action or task, and
70you can create a shortcut for any action that you can express as an intent. For example, you
71can create intents for sending a new text message, making a reservation, playing a video,
72continuing a game, loading a map location, and much more.
73
74You can create shortcuts for your app statically by adding them to a resource file in the APK,
75or you can add them dynamically at runtime. Static shortcuts are ideal for common actions,
76and dynamic shortcuts let you highlight actions based on users' preferences, behavior, location,
77and so on. This sample demonstrates both types of shortcuts.
78
79You can offer up to five shortcuts in each of your apps.
80
81After your app adds shortcuts, they're available on any launcher that supports them, such as the
82Pixel launcher (the default launcher on Pixel devices), the Now launcher (the default launcher on
83Nexus devices), and other launchers that provide support.
84
85For more information on creating shortcuts, see the [Shortcuts to App Actions][1] developer guide.
86
87[1]: https://developer.android.com/preview/shortcuts.html
88]]>
89        </intro>
90    </metadata>
91</sample>
92