Ringkasan Aktivitas Web Tepercaya
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Aktivitas Web Tepercaya adalah cara baru untuk membuka konten aplikasi web Anda seperti Anda Progressive Web App (PWA) dari Anda aplikasi Android menggunakan protokol berdasarkan Tab Kustom.
Catatan: Aktivitas Web Tepercaya tersedia di Chrome di Android, versi 72 dan yang lebih baru.
Mencari kode?
Ada beberapa hal yang membuat Aktivitas Web Tepercaya berbeda dari cara lain untuk membuka konten web dari aplikasi Android Anda:
- Konten dalam Aktivitas Web Tepercaya tepercaya -- aplikasi dan situs yang dibuka diharapkan berasal dari developer yang sama. (Hal ini diverifikasi menggunakan Digital Asset Links.)
- Konten yang dirender di Aktivitas Web Tepercaya berasal dari web: konten tersebut dirender oleh browser pengguna, dengan cara yang sama persis seperti yang akan dilihat pengguna di browser mereka, kecuali konten tersebut dijalankan dalam layar penuh. Konten web harus dapat diakses dan bermanfaat di browser terlebih dahulu.
- Browser juga diupdate secara terpisah dari Android dan aplikasi Anda. Hal ini menghemat ukuran APK dan memastikan Anda dapat menggunakan runtime web modern. (Perhatikan bahwa sejak Lollipop, WebView juga telah diupdate secara independen dari Android, tetapi ada sejumlah besar pengguna Android pra-Lollipop.)
- Aplikasi host tidak memiliki akses langsung ke konten web di Aktivitas Web Tepercaya atau jenis status web lainnya, seperti cookie dan
localStorage
. Namun, Anda dapat berkoordinasi dengan konten web dengan meneruskan data ke dan dari halaman dalam URL (misalnya, melalui parameter kueri dan URI intent).
- Transisi antara konten web dan native berada di antara aktivitas. Setiap aktivitas (yaitu layar) aplikasi Anda sepenuhnya disediakan oleh web, atau oleh aktivitas Android
Untuk mempermudah pengujian, saat ini tidak ada kualifikasi untuk konten yang dibuka di pratinjau Aktivitas Web Tepercaya. Namun, Anda dapat mengharapkan bahwa aktivitas Web Tepercaya harus memenuhi persyaratan Tambahkan ke Layar Utama yang sama. Anda dapat mengaudit situs untuk persyaratan ini menggunakan audit "pengguna dapat diminta untuk Menambahkan ke Layar utama" Lighthouse.
Saat ini, browser lain dapat menerapkan protokol yang sama dengan yang digunakan aktivitas Web Tepercaya. Meskipun aplikasi host memiliki keputusan akhir tentang browser yang dibuka, sebaiknya gunakan kebijakan yang sama seperti untuk Tab Khusus: gunakan browser default pengguna, selama browser tersebut menyediakan kemampuan yang diperlukan.
Mau ke mana berikutnya?
Jika Anda ingin mem-build aplikasi Android dengan cepat yang baru saja memulai dan membuka PWA, lihat Panduan Memulai Cepat.
Jika Anda mengintegrasikan Aktivitas Web Tepercaya ke dalam Aplikasi Android yang ada, Panduan Integrasi adalah tempat yang tepat untuk memulai.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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."]]