Technical
How to Monitor and Optimise Android Vitals for TWA Apps
November 10, 2026 · 6 min read
When you publish a Progressive Web App on the Google Play Store using a Trusted Web Activity, your application is subject to the exact same performance standards as a fully native Kotlin or Java application. Google Play tracks these performance metrics through a system known as Android Vitals. If your app falls below specific performance thresholds, Google Play may penalise your store visibility, lower your search ranking, or even exclude your app from organic recommendations.
What are Android Vitals in the Context of a TWA
Android Vitals is a diagnostic initiative by Google to improve the stability and performance of Android devices. When opted-in users run your app, their devices log performance metrics, which Google aggregates in the Google Play Console. Because a Trusted Web Activity runs inside a highly optimised, secure browser container powered by Chrome, many developers mistakenly believe their app is immune to native performance penalties. This is not true.
The Android operating system measures the rendering performance and resource usage of your app wrapper, including the Chrome Custom Tab process running underneath it. If your web app has long-running JavaScript execution, inefficient CSS animations, or high memory leaks, these web-level performance bottlenecks will register as native app performance regressions in Android Vitals.
Key Android Vitals Metrics for Web Apps
Google Play focuses heavily on several core vitals. Understanding how web-level problems translate to these native indicators is essential for maintaining a healthy store listing.
| Android Vitals Metric | Google Play Threshold | Common Web Cause | Impact on Android System |
|---|---|---|---|
| Slow Rendering (16ms) | Under 10% of frames | Complex CSS layouts, unoptimised animations, domestic layout thrashing | Jumpy rendering, high battery consumption |
| Frozen Frames (700ms) | Under 0.1% of frames | Synchronous JavaScript, blocking API calls, main-thread blocking | UI appears completely locked up to the user |
| App Not Responding (ANR) | Under 0.47% of sessions | Long-running main thread tasks, deadlocks in service workers | Android prompts the user to force-close the application |
| Excessive Wake Locks | Under 0.1% of sessions | Background service worker tasks that fail to terminate gracefully | Severe battery drain when the device screen is off |
Diagnosing Slow Rendering and Frozen Frames in TWAs
A frame is slow when the device takes longer than 16.6 milliseconds to render it, which drops the frame rate below 60 frames per second. A frozen frame is a frame that takes longer than 700 milliseconds to render. To diagnose these inside your Trusted Web Activity, you must use the remote debugging capabilities of Google Chrome.
Connect your physical testing device with USB debugging enabled, navigate to chrome://inspect in your desktop browser, and launch your installed TWA. Open the Performance panel to record a profile of your application during transition states and heavy interactions.
Look closely at the main thread execution timeline. Any task marked with a red flag is a long task taking longer than 50 milliseconds. To eliminate these issues, apply the following optimisations:
- Debounce and Throttle Events: Ensure scroll, resize, and touch events do not trigger heavy DOM updates directly. Wrap handlers in requestAnimationFrame to execute updates when the browser is ready to paint.
- Adopt Content-Visibility: Use the modern CSS property content-visibility auto to skip rendering off-screen elements, reducing the overall layout computation cost.
- Minimise Paint Areas: Avoid animating properties that trigger layout recalculation, such as height, width, top, or left. Use transform and opacity instead, which run directly on the compositor thread.
Preventing Excessive Background Wake Locks
A wake lock is a mechanism that keeps the device CPU awake even after the screen has turned off. While native apps use these for background syncing, a TWA can trigger wake locks indirectly through active media playback, WebSocket connections, or background synchronization processes initiated by your service worker.
If your service worker carries out heavy background tasks, it can prevent Chrome from going to sleep. This registers as a persistent background wake lock in your Google Play Console dashboard, prompting a warning.
To avoid this, ensure your service worker does not run infinite polling routines. Use the native Web Push API for notifications instead of maintaining active, continuous WebSocket connections in the background. If you must use WebSockets, close the connection explicitly in response to the page visibility API changing to hidden.
Example: Managing Connections Based on Page Visibility
document.addEventListener("visibilitychange", () => { if (document.hidden) { disconnectWebSocket(); } else { reconnectWebSocket(); } });
Monitoring Vitals in the Google Play Console
To inspect your current vitals status, log in to your Google Play Console, select your TWA application, and navigate to the Quality section, then click on Android Vitals. Look for any metrics highlighted with a red exclamation mark, indicating that your app is currently above the bad behavior threshold.
If you see a surge in ANR rates or crash rates, check the stack traces provided by the Play Console. For TWA apps, native crashes are rare and usually indicate an issue with device compatibility or a crash within the underlying Webview implementation of a specific Android system version. However, ANR reports often trace back to the custom customisation layers of your TWA wrapper, such as custom splash screens or deep-link redirect processing on startup. Ensure your native Java/Kotlin code does not block the UI thread during launch.
A Checklist for TWA Android Vitals Maintenance
To ensure your TWA app maintains high performance and retains its positioning in the Google Play Store, integrate the following checks into your release workflow:
- Monitor your core Web Vitals, especially Interaction to Next Paint (INP), as it correlates directly with Android's native frozen frames and slow rendering metrics.
- Audit your application with Lighthouse on mobile profiles to guarantee your performance score stays high.
- Avoid long-running background tasks inside service workers by setting sensible timeouts and exiting fetch listeners quickly.
- Validate your Digital Asset Links file to ensure the browser does not spend unnecessary time verifying your origin on cold starts.
Ready to build for Android and iOS?
€49.99 once includes unlimited Android APK and AAB plus iOS IPA builds, all from one dashboard.
Build my app