דוגמאות ל-Android 7.1
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
דוגמאות הקוד הבאות הן לגרסה Android 7.1 (API 25). כדי להוריד את הדוגמאות ב-Android Studio, בוחרים באפשרות File > New > Import Sample בתפריט.
הערה: הפרויקטים שניתן להורדה מיועדים לשימוש עם Gradle ו-Android Studio.
דוגמה לקיצורי דרך של אפליקציות
בדוגמה הזו מוצג איך להשתמש ב-App Shortcuts API, שהוצג ב-Android 7.1 (רמת API 25). ממשק ה-API הזה מאפשר לאפליקציה להגדיר קבוצה של כוונות שיוצגו כשהמשתמש לוחץ לחיצה ארוכה על סמל האפליקציה במרכז האפליקציות. מוצגות דוגמאות לרישום קישורים באופן סטטי ב-XML וגם באופן דינמי בזמן הריצה.
דוגמה לקיצורי דרך של אפליקציות
דוגמה לאפליקציית מקלדת תמונה
בדוגמה הזו מוצג איך להטמיע את
Commit Content API באמצעות Android Support Library.
ה-API הזה מספק דרך אוניברסלית ל-IMEs לשלוח תמונות ותוכן עשיר אחר ישירות לעורך טקסט באפליקציה, ומאפשר למשתמשים ליצור תוכן באמצעות אמוג'ים בהתאמה אישית, סטיקרים או תוכן עשיר אחר שמסופק על ידי אפליקציות אחרות.
דוגמה לאפליקציית מקלדת תמונות
דוגמה ל-IME של מקלדת תמונות
בדוגמה הזו מוצג איך לכתוב מקלדת תמונות בהתאמה אישית באמצעות
Commit Content API ו-Android Support Library.
המקלדת הזו תוצג באפליקציות תואמות (גם באמצעות Commit Content API), ותאפשר למשתמשים להוסיף סמלי אמוג'י, סטיקרים או תוכן עשיר אחר לעורכי טקסט.
דוגמה ל-IME של מקלדת תמונות
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. 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,["# Android 7.1 Samples\n\nThe following code samples are provided for Android 7.1 (API 25). To\ndownload the samples in Android Studio, select the **File \\\u003e New \\\u003e Import Sample** menu\noption.\n\n\n**Note:** These downloadable projects are designed\nfor use with Gradle and Android Studio.\n\n### App shortcuts sample\n\n\nThis sample demonstrates how to use the [app shortcuts API](/guide/topics/ui/shortcuts)\nintroduced in Android 7.1 (API level 25). This API allows an application to define a set of\nintents which are displayed when a user long-presses on the app's launcher icon. Examples are\ngiven for registering links both statically in XML, as well as dynamically at runtime.\n\n\n[App shortcuts sample](https://github.com/android/user-interface-samples/tree/main/AppShortcuts)\n\n### Image keyboard app sample\n\n\nThis sample demonstrates how to implement the [Commit Content API](/reference/android/view/inputmethod/InputConnection#commitContent(android.view.inputmethod.InputContentInfo,%20int,%20android.os.Bundle)), using the [Android Support Library](/topic/libraries/support-library).\nThis API provides a universal way for IMEs to send images and other rich\ncontent directly to a text editor in an app, allowing users to compose\ncontent using custom emojis, stickers, or other rich content provided by\nother applications.\n\n\n[Image keyboard app sample](https://github.com/android/input-samples/tree/main/CommitContentSampleApp)\n\n### Image keyboard IME sample\n\n\nThis sample demonstrates how to write a [custom image keyboard](/preview/image-keyboard) using the [Commit Content API](/reference/android/view/inputmethod/InputConnection#commitContent(android.view.inputmethod.InputContentInfo,%20int,%20android.os.Bundle)) and the [Android Support Library](/topic/libraries/support-library).\nThis keyboard will be displayed inside compatible apps (also using the Commit\nContent API), allowing users to insert emojis, stickers, or other rich\ncontent into text editors.\n\n\n[Image keyboard IME sample](https://github.com/android/input-samples/tree/main/CommitContentSampleIME)"]]