Using Android Vitals to Track Your Apps Performance
We're going to show you how to use Android vitals to keep an eye on your app's engineering and performance metrics so you can fix any problems that may affect your users.
Why is it important to track your engineering metrics? Because when your app performs badly, users notice. In fact, almost half of one-star reviews on the Play Store mentioned performance issues like app stability.
On the other hand, when things are running smoothly, users are happy.
Android vitals tracks the metrics that matter most to your users, battery use, stability, rendering, startup time, and permission requests.
Let's start with battery use because it's probably the most important of all. Nobody wants to use an app that drains their battery.
Android vitals reports on the four most significant causes of battery drain: wake locks, wake ups, background WiFi scans, and background network use.
Background Partial Wake Locks
Background partial wake locks are when your app keeps the CPU running after the device display turns off. It can become stuck if it's held for a long time while your app runs in the background.
This can drain the user's battery, so you should use them sparingly and release them as soon as possible.
Excessive Wake Ups
The second cause of battery drain is excessive wake ups. These let your app wake up a device at a certain time, bringing it out of low power mode and holding a partial wake lock while the alarm executes.
Again, these can drain your user's battery, and you want to use them as little as possible.
Excessive Background WiFi Scans and Network Use
The last two battery related metrics are excessive background WiFi scans and network use.
In both cases, your app connects to the Internet in the background, waking up the CPU and turning on the radio, which is draining the user's battery.
If your app doesn't use any of these features, then you will not see metrics in vitals for them. Also, if your app does not have enough users above the privacy threshold, then you will not see any data either.
So, now that we've covered battery life, the next most important area of Android vitals to focus on is app stability.
Android vitals tracks two stability metrics, ANR events and crashes.
Application not responding are ANR events or when your app stops responding to user input. This happens when the UI thread of the app is blocked for too long, so the user's app appears to freeze on them.
Crashes occur when unhandled exception or signal cause your app to exit unexpectedly.
Of course, you'll want to keep both of these to a minimum.
Your Android vitals dashboard also displays rendering metrics. Users want a fast responsive application that runs smoothly and doesn't lag or stall, so Android vitals tracks any instances of slow rendering or frozen frames.
Slow rendering is when your app can't render frames in under 16 milliseconds. When this happens, your app appears to stutter.
Frozen frames occur when UI frames take longer than 700 milliseconds to render. This makes your app appear stuck and unresponsive to user input for almost a second.
Users also expect your app to launch quickly. On your Android vitals dashboard, you can easily identify when your app is loading slowly, with different metrics for cold starts, warm starts and hot starts.
A cold start is when your app hasn't been launched for a while and isn't in the device's memory. This means the device needs to create and start all your app's resources to get it running. In this case, a slow start would mean five seconds or more.
A warm start is when your app is in memory and simply needs to go from activity launched to activity running. In this case, a slow start will be two seconds or more.
Finally, a hot start is when your app and its activity are in memory, and the system brings your activity to the foreground.
From a hot start, your app shouldn't take longer than 1.5 seconds to load.
The last metric in your dashboard is all about permissions. Here, you'll see the percentage of people who denied a permission request made by your app.
If the level is high, you may need to explain the reason for your request or rethink whether you actually need that permission at all.
So, how do you know if your metrics are good? On the dashboard, you'll see benchmarks for each vital to help you understand how your app or game is performing, and which issues, if any, to prioritise.
For example, people expect board games to load faster than racing games, so your metrics will only be measured against similar apps.
Not sure what to focus on first? Well, all of your metrics are important to monitor.
The four most important ones on your Android vitals dashboard are ANR rate, crash rate, stuck wake locks in the background, and excessive wake ups. These are called the core vitals.
Hopefully your app's metrics all look good, but if something should go wrong, it's important to fix the problem as quickly as possible. That's why Android vitals also provides a useful anomalies section.
Just click on the dashboard alert to learn more about the problem, or you can sign up for anomaly alerts emails. Addressing these issues as quickly as possible not only keeps your users happy, it also helps improve your app's profile in the Play Store, such as its discoverability in the search results.
Android vitals gives you the tools to monitor your app's performance and keep it running smoothly.