Quick detection of an ANR issue (Application Not Responding)

How to find out a deadlock is happening?

Francisco Riádigos
AndroidPub

--

I recently got struggled with a scenario where my App was blocked for some reason and it never showed a ANR dialog. I discovered it happened due to a specific Deadlock that was not part of my code, and I also found out an interesting option of Android Studio I wanted to share. By using this option you can reduce the amount of time you spend researching these sort of issues with other tools like TraceView.

The Android documentation says:

“…background ANR dialogs are not always displayed to the user, but the app could still be experiencing performance issues.

My name is Francisco Riádigos and I’d like to show you how to achieve this easily. For instance, in a thread different than the main one, a process can get stuck because of a synchronisation lock, causing other processes elsewhere to never being fired at all, and if the user is never aware of it, since that thread is not blocking/freezing the UI, all further operations done in the background will never be executed.

--

--

Francisco Riádigos
AndroidPub

Former @LloydsBank, @BritishAirways, @SkyUK, @Wefox, @Indra... Co-founder @Chatty