Trusted Web Activities (TWA): Packaging PWAs for Google Play

For web developers with existing Progressive Web Apps (built in Next.js, React, or Vue), rewriting the entire application in native code is often unnecessary. Trusted Web Activities (TWA) allow you to package your high-performance PWA into a standard Android App Bundle (AAB) and publish it directly to the Google Play Store.

How TWA Differs from a Standard WebView

Dimension Standard WebView Trusted Web Activity (TWA)
Browser Engine Embedded WebKit/Chromium container inside the app User's native Chrome browser instance (Chrome Custom Tabs)
Shared Storage Isolated; user must log in again from scratch Shared cookies, localStorage, auto-fill & saved passwords with Chrome!
URL Address Bar No address bar (custom embedded) Completely hidden once Digital Asset Links verify domain ownership!
Web Capabilities Restricted HTML5 features Full PWA capabilities: Web Push, Web Payments, WebAuthn Passkeys, WebGL

Verifying Domain Ownership: Digital Asset Links (assetlinks.json)

To remove the browser address bar and run full screen as a native application, you must establish two-way trust between your website domain and your Android app package by hosting a file at /.well-known/assetlinks.json:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.veewom.android",
    "sha256_cert_fingerprints": [
      "14:6D:E9:D6:0F:4B:D6:4C:85:49:6A:35:86:7D:34:BE:F4:76:77:81:6A:FC:45:D6:70:E2:B3:A2:38:A2:BC:FC"
    ]
  }
}]

Automating TWA Generation with Bubblewrap CLI

Google maintains the official Bubblewrap CLI, which automatically inspects your Web App Manifest and generates a production-ready Android Studio project:

# 1. Install Bubblewrap CLI globally via npm
npm install -g @bubblewrap/cli

# 2. Initialize project from your live PWA manifest
bubblewrap init --manifest https://veewom.com/manifest.json

# 3. Build signed Android App Bundle (AAB) for Google Play
bubblewrap build

Frequently Asked Questions (FAQ) - Student & Interview Review

Q1. Why does my TWA show a Chrome URL address bar at the top?

If the URL bar appears, your Digital Asset Links verification failed! Ensure `/.well-known/assetlinks.json` is served over valid HTTPS with content-type `application/json`, and that the SHA-256 fingerprint exactly matches your app's signing key.

Q2. Can a TWA access native Android features like notifications?

Yes! TWAs support standard W3C Web Push notifications directly. Additionally, you can add custom native Android background services to your project alongside the TWA.

Q3. Does Google Play allow Trusted Web Activity apps in the store?

Yes! Major global applications (including Twitter/X Lite, Pinterest, and Forbes) use Trusted Web Activities on the Google Play Store.

Explore Related Android Development Classes & Next Steps

Broaden your foundational and advanced Android application development skills across our curriculum:

WebView & JavaScript Bridge

Compare full PWA packaging with hybrid WebView bridges.

Deep Linking & Digital Asset Links

Host assetlinks.json on your domain to remove the browser address bar.

Play Store App Bundle Publishing

Generate signed AAB bundles for Bubblewrap TWA applications.

Firebase Push Notifications

Combine Web Push notifications with native Android notifications.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Reddit

You may also like this!