Android 7.1 サンプル
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
次のコードサンプルは Android 7.1(API 25)用です。Android Studio でサンプルをダウンロードするには、[File] > [New] > [Import Sample] メニュー オプションを選択します。
注: 以下のダウンロード可能なプロジェクトは、Gradle と Android Studio でご利用いただくために提供しています。
アプリのショートカットの例
このサンプルは、Android 7.1(API レベル 25)で導入された アプリ ショートカット API の使用方法を紹介します。この API では、ユーザーがアプリのランチャー アイコンを長押ししたときに表示される、インテントのセットを定義できます。XML 内で静的に登録するリンクと、実行時に動的に登録するリンクの両方の例を示します。
アプリ ショートカットのサンプル
イメージ キーボード アプリのサンプル
このサンプルは、Android サポート ライブラリを使用して
Commit Content API を実装する方法を示しています。この API により、IME は、アプリ内のテキスト エディタに画像や各種リッチ コンテンツを直接送信できるようになります。これにより、ユーザーはカスタム絵文字、ステッカー、または他のアプリが提供するその他のリッチ コンテンツを使用してコンテンツを作成できます。
画像キーボード アプリのサンプル
イメージ キーボード IME のサンプル
このサンプルは、
Commit Content API と Android サポート ライブラリを使用してカスタム画像キーボードを作成する方法を示しています。このキーボードは、互換性のあるアプリ(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)"]]