Trusted Web Activity の概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Trusted Web Activity は、カスタムタブに基づくプロトコルを使用して、Android アプリからプログレッシブ ウェブアプリ(PWA)などのウェブアプリ コンテンツを開く新しい方法です。
注: Trusted Web Activity は、Android 版 Chrome バージョン 72 以降で利用できます。
コードを探す
Trusted Web Activity は、Android アプリからウェブ コンテンツを開く他の方法とはいくつかの点で異なります。
- 信頼できるウェブ アクティビティのコンテンツは信頼できるものであり、アプリとそのアプリが開くサイトは同じデベロッパーのものである必要があります。(これは デジタル アセット リンクを使用して検証されます)。
- 信頼できるウェブ アクティビティでレンダリングされるコンテンツはウェブから取得されます。ユーザーのブラウザでレンダリングされ、全画面で実行される点を除き、ユーザーがブラウザで表示するコンテンツとまったく同じ方法で表示されます。ウェブ コンテンツは、まずブラウザでアクセス可能で有用である必要があります。
- ブラウザも Android やアプリとは別に更新されるため、APK のサイズを削減し、最新のウェブ ランタイムを使用できます。(Lollipop 以降、WebView は Android とは別にアップデートされていますが、Lollipop より前の Android ユーザーはかなりの数に上ります)。
- ホストアプリは、信頼できるウェブ アクティビティ内のウェブ コンテンツや、Cookie や
localStorage
などの他の種類のウェブ状態に直接アクセスできません。ただし、URL でページとの間でデータをやり取りすることで、ウェブ コンテンツと連携させることができます(クエリ パラメータやインテント URI など)。
- ウェブ コンテンツとネイティブ コンテンツの切り替えは、アクティビティ間で行われます。アプリの各アクティビティ(画面)が、ウェブまたは Android アクティビティによって完全に提供される
テストを容易にするため、現在のところ、Trusted Web Activity のプレビュー版で開くコンテンツの資格要件はありません。ただし、信頼できるウェブ アクティビティは、ホーム画面に追加と同じ要件を満たす必要があります。これらの要件を満たしているかどうかは、Lighthouse の「ユーザーにホーム画面に追加するよう求めるメッセージが表示される」監査で確認できます。
現在、他のブラウザでも、信頼できるウェブ アクティビティで使用されているプロトコルを実装できます。どのブラウザを開くかを最終的に決定するのはホストアプリですが、カスタムタブの場合と同じポリシー(必要な機能が提供されている限り、ユーザーのデフォルト ブラウザを使用する)をおすすめします。
次はどこに行く?
PWA を起動して開くだけの Android アプリをすばやく作成する場合は、クイック スタート ガイドをご覧ください。
Trusted Web Activity を既存の Android アプリに統合する場合は、統合ガイドを参照してください。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。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,["# Overview of Trusted Web Activities\n\n**Trusted Web Activity** is a new way to open *your* web-app content such as *your* Progressive Web App (PWA) from *your* Android app using a protocol based on Custom Tabs.\n\n**Note** : Trusted Web Activity is available in [Chrome on Android](https://play.google.com/store/apps/details?id=com.android.chrome), version 72 and above.\n\n*Looking for the code?*\n\n- [android-browser-helper library on GitHub](https://github.com/GoogleChrome/android-browser-helper)\n- [Trusted Web Activity demos](https://github.com/GoogleChrome/android-browser-helper/tree/master/demos)\n- [Bubblewrap, a NodeJs library / CLI to generate and build Trusted Web Activity projects](https://github.com/GoogleChromeLabs/bubblewrap)\n\nThere are a few things that make Trusted Web Activity different from other ways to open web content from your Android app:\n\n1. Content in a Trusted Web activity is **trusted** -- the app and the site it opens are expected to come from the same developer. (This is verified using [Digital Asset Links](https://developers.google.com/digital-asset-links/v1/getting-started).)\n2. The content rendered in a Trusted Web Activity comes from the **web**: they're rendered by the user's browser, in exactly the same way as a user would see it in their browser except they are run fullscreen. Web content must be accessible and useful in the browser first.\n3. Browsers are also updated independent of Android and your app. That saves on APK size and ensures you can use a modern web runtime. (Note that since Lollipop, WebView has also been updated independent of Android, but there are a [significant number](/about/dashboards) of pre-Lollipop Android users.)\n4. The host app doesn't have direct access to web content in a Trusted Web Activity or any other kind of web state, like cookies and `localStorage`. Nevertheless, you can coordinate with the web content by passing data to and from the page in URLs (e.g. through query parameters and [intent URIs](https://developer.chrome.com/docs/multidevice/android/intents).)\n5. Transitions between web and native content are between **activities**. Each activity (i.e. screen) of your app is either completely provided by the web, or by an Android activity\n\nTo make it easier to test, there are currently no qualifications for content opened in the preview of Trusted Web activities. You can expect, however, that Trusted Web activities need to meet the same [Add to Home Screen](https://web.dev/customize-install#criteria) requirements. You can audit your site for these requirements using the [Lighthouse](https://web.dev/measure/) \"*user can be prompted to Add to Home screen*\" audit.\n\nToday, it is possible for other browsers to implement the same protocol that Trusted Web activities use. While the host app has the final say on what browser gets opened, we recommend the same policy as for Custom Tabs: use the user's default browser, so long as that browser provides the required capabilities.\n\nWhere to go next?\n-----------------\n\nIf you are looking for quickly building an Android app that just starts and opens your PWA, checkout out the [Quick Start Guide](https://developer.chrome.com/docs/android/trusted-web-activity/quick-start).\n\nIf integrating Trusted Web Activity into an existing Android App, the [Integration Guide](https://developer.chrome.com/docs/android/trusted-web-activity/integration-guide) is a good place to get started."]]