DEV Community

Miguel Munoz
Miguel Munoz

Posted on

1

Android interview: ANR

In the last days, my company gives me the task to do some short and simple interviews to applicants for the Android position.

One of the questions is about ANR. This question is one of the main ways to know if a developer knows about Android and sometimes is one of the questions in the top companies.

But, what is an ANR?

An ANR or Application Not Responding, is a simple error caused by the block of the UI Thread.

If the UI Thread is blocked for 5 seconds or more, we are going to get this issue and a Dialog will be showed asking if we want to wait or close the app.

This happens because maybe we have a long-performance task and Android can't draw in the UI Thread or can't receive any event from the user.

The cause of this could be a lot of things, but if you understand what is an ANR, you will be able to find the issue that is causing it. It could be a long task trying to do download something or maybe a large image trying to get showed.

If any of my post have mistakes, I am open to any feedback. Sometimes I could do bad explanation, so any comment is welcome. Together we can create a better guide to study and learn.

Image of Wix Studio

2025: Your year to build apps that sell

Dive into hands-on resources and actionable strategies designed to help you build and sell apps on the Wix App Market.

Get started

Top comments (0)

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay