קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מפתחים יכולים להגדיר קיצורי דרך לביצוע פעולות ספציפיות באפליקציה. אפשר להציג את קיצורי הדרך האלה במרכז אפליקציות או בעוזר דיגיטלי נתמך – כמו Google Assistant – ולעזור למשתמשים להתחיל במהירות משימות נפוצות או מומלצות באפליקציה.
במסמכי התיעוד האלה מוסבר איך ליצור ולנהל קיצורי דרך לאפליקציות. כדאי גם לעיין בשיטות המומלצות לשיפור קיצורי הדרך.
סוגי קיצורי דרך
איור 1. באמצעות קיצורי דרך לאפליקציות, אתם יכולים להציג פעולות מרכזיות ולהעביר את המשתמשים ישירות לאפליקציה שלכם.
כל קיצור דרך מפנה אל כוונה אחת או יותר, וכל כוונה מפעילה פעולה ספציפית באפליקציה כשמשתמשים בוחרים את קיצור הדרך. סוגי קיצורי הדרך שיוצרים לאפליקציה תלויים בתרחיש השימוש באפליקציה.
דוגמאות לפעולות שאפשר לבצע באמצעות קיצורי דרך:
כותבים אימייל חדש באפליקציית אימייל.
הפניית משתמשים למיקום מסוים באפליקציית מיפוי.
שליחת הודעות לאיש קשר של משתמש באפליקציית תקשורת.
הפעלת הפרק הבא של תוכנית טלוויזיה באפליקציית מדיה.
טעינה של נקודת השמירה האחרונה באפליקציית משחקים.
משתמש מזמין משקה באפליקציית משלוחים באמצעות פקודות קוליות.
אפשר לפרסם את סוגי קיצורי הדרך הבאים לאפליקציה:
קיצורי דרך סטטיים מוגדרים בקובץ משאבים שנארז ב-APK או בחבילת אפליקציות.
מקשי קיצור דינמיים יכולים להידחף, להתעדכן ולהימחק על ידי האפליקציה
רק בזמן הריצה.
אפשר להוסיף קיצורי דרך מוצמדים ל-Launchers נתמכים בזמן הריצה אם המשתמש מעניק הרשאה.
הצגת קיצורי דרך בממשקי עזרה באמצעות יכולות
היכולות ב-shortcuts.xml מאפשרות לכם להצהיר על סוגי הפעולות שהמשתמשים יכולים לבצע כדי להפעיל את האפליקציה ולעבור ישירות לביצוע משימה ספציפית. לדוגמה, אפשר לתת למשתמשים שליטה קולית באפליקציה באמצעות Google Assistant על ידי הצהרה על רכיבי capability שמרחיבים את הפונקציונליות של האפליקציה ל-Assistant פעולות באפליקציה. פרטים נוספים זמינים במאמר בנושא הוספת יכולות.
מגבלות על קיצורי דרך
ברוב מרכזי האפליקציות הנתמכים מוצגים עד ארבעה קיצורי דרך בכל פעם, כולל קיצורי דרך סטטיים ודינמיים. כשדוחפים קיצורי דרך דינמיים להצגה בפלטפורמות של Google, כמו Google Assistant, כדאי להשתמש בספריית השילוב של קיצורי הדרך של Google כדי לא לחרוג ממגבלת קיצורי הדרך.
אם תבחרו שלא להשתמש בספריית השילוב של קיצורי הדרך של Google, האפליקציה שלכם תהיה כפופה למגבלה של המכשיר לגבי מספר קיצורי הדרך שהוא תומך בהם בכל פעם. קיצורי הדרך שמתפרסמים בדרך הזו מופיעים רק במרכזי האפליקציות של Android, ולא ניתן למצוא אותם בפלטפורמות של Google כמו Assistant.
אין הגבלה על מספר קיצורי הדרך המוצמדים שהמשתמשים יכולים ליצור לאפליקציה שלכם. האפליקציה לא יכולה להסיר קיצורי דרך מוצמדים, אבל היא יכולה להשבית אותם.
כדי להתחיל ליצור קיצורי דרך לאפליקציה, אפשר לעיין במסמכים הבאים:
פרטים נוספים על פעולות שאפשר לבצע בקיצורי דרך מופיעים בShortcutManager
מאמרי העזרה בנושא API.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# App shortcuts overview\n\nAs a developer, you can define *shortcuts* to perform specific actions\nin your app. You can display these shortcuts in a supported launcher or\nassistant---like Google Assistant---and help your users quickly start\ncommon or recommended tasks within your app.\n\nThis documentation shows you how to\n[create](/guide/topics/ui/shortcuts/creating-shortcuts) and\n[manage](/guide/topics/ui/shortcuts/managing-shortcuts) app\nshortcuts. You can also learn some\n[best practices](/guide/topics/ui/shortcuts/best-practices) to\nimprove your shortcuts.\n\nShortcut types\n--------------\n\n**Figure 1.** Using app shortcuts, you can surface key actions and instantly take users deep into your app.\n\nEach shortcut references one or more\n[intents](/guide/components/intents-filters), each of which\nlaunches a specific action in your app when users select the shortcut. The\ntypes of shortcuts you create for your app depend on the app's use case.\nExamples of actions you can express as shortcuts include the following:\n\n- Composing a new email in an email app.\n- Navigating users to a particular location in a mapping app.\n- Sending messages to a user's contact in a communication app.\n- Playing the next episode of a TV show in a media app.\n- Loading the last save point in a gaming app.\n- Letting the user order a drink in a delivery app using spoken commands.\n\n| **Note:** Only main activities---activities that handle the [Intent.ACTION_MAIN](/reference/android/content/Intent#ACTION_MAIN) action and the [Intent.CATEGORY_LAUNCHER](/reference/android/content/Intent#CATEGORY_LAUNCHER) category---can have shortcuts. If an app has multiple main activities, define the set of shortcuts for each activity.\n\nYou can publish the following types of shortcuts for your app:\n\n- *Static shortcuts* are defined in a resource file that is packaged into an APK or [app bundle](/guide/app-bundle/build).\n- *Dynamic shortcuts* can be pushed, updated, and removed by your app only at runtime.\n- *Pinned shortcuts* can be added to supported launchers at runtime if the user grants permission. **Note:** Users can also create pinned shortcuts by copying your app's static and dynamic shortcuts onto the launcher.\n\nDisplay shortcuts in assistants using capabilities\n--------------------------------------------------\n\n*Capabilities* in `shortcuts.xml` let you declare the types\nof actions users can take to launch your app and jump directly to performing a\nspecific task. For example, you can give users voice control of your app through\nGoogle Assistant by declaring `capability` elements that extend your\nin-app functionality to Assistant\n[App\nActions](https://developer.android.com/guide/app-actions/overview#app_actions). For more details, see the documentation about\n[adding\ncapabilities](/guide/topics/ui/shortcuts/adding-capabilities).\n\nShortcut limitations\n--------------------\n\nMost supported launchers display up to four shortcuts at a time, including\nboth static and dynamic shortcuts. When pushing dynamic shortcuts for display on\nGoogle's surfaces, such as Google Assistant, use the\n[Google\nShortcuts Integration Library](/guide/topics/ui/shortcuts/creating-shortcuts#gsi-library) to avoid being subject to the shortcut\nlimit.\n\nIf you choose not to use the Google Shortcuts Integration Library, your app\nis subject to the device's limit for the number of shortcuts it supports at a\ntime. Shortcuts published this way only appear within the Android launchers and\naren't discoverable on Google surfaces such as Assistant.\n| **Note:** The maximum number of shortcuts a device supports varies. Use the [`getMaxShortcutCountPerActivity()`](//developer.android.com/reference/androidx/core/content/pm/ShortcutManagerCompat#getMaxShortcutCountPerActivity(android.content.Context)) method to determine how many shortcuts a particular device supports.\n\nThere is no limit to the number of pinned shortcuts users can create to your\napp. Your app can't remove pinned shortcuts, but it can\n[disable](/guide/topics/ui/shortcuts/managing-shortcuts#disable-shortcuts)\nthem.\n| **Note:** Although other apps can't access the metadata within your shortcuts, the launcher itself can access this data. Therefore, conceal sensitive user information in this metadata.\n\nTo start creating shortcuts for your app, refer to the following\ndocumentation:\n\n- [Create shortcuts](/guide/topics/ui/shortcuts/creating-shortcuts)\n- [Manage shortcuts](/guide/topics/ui/shortcuts/managing-shortcuts)\n- [Best practices for\n shortcuts](/guide/topics/ui/shortcuts/best-practices)\n\nFor more details about operations you can perform on shortcuts, see the\n[ShortcutManager](/reference/android/content/pm/ShortcutManager)\nAPI reference documentation."]]