Understanding how stable your Android app is can be challenging once you have released it. An important part of stability is understanding all the different ways that your app process ends. The operating system has a great degree of control in how an app process can be terminated, so it is not possible to get a complete picture of all types of process terminations from within an app.
So, what do you do? Well, for older Android versions your options are limited, but Android 11 introduced the ApplicationExitInfo API, which gives you insight into your app’s most recent process terminations. This API also provides info about Application Not Responding (ANR) errors, similar to what you will see for your app in the Google Play Console, even if the ANR did not directly lead to the process termination.
In this post, we’ll provide an overview of the ApplicationExitInfo API, how to use it, what its strengths and weaknesses are, and how you can best leverage this data to improve your mobile user experiences.