Profiler: Android: Find Input ANR

TimothyGraupmannTimothyGraupmann USMember
edited August 2016 in Visual Studio

ANR - Activity Not Responding happens on Android when you block the rendering/main thread for 5 seconds or more.

I'm using MonoGame which is built on top of Xamarin and I'm using the Xamarin Profiler.

I can repro an ANR caused by input by rapidly moving a controller axis during the Activity and Game initialization.

The Xamarin Time Profiler is handy which tracks the cumulative time spent in particular methods.

In my case though, I'm searching for any function or method that takes 3 or more seconds to execute.

This would be a handy feature to add to the Xamarin profiler which would help find any slow methods on the main thread.

Thanks,

~Tim Graupmann

Tagged:

Posts

  • TimothyGraupmannTimothyGraupmann USMember
    edited August 2016

    Another cause of an ANR can occur if you have multiple methods on the main/rendering thread that take 3+ seconds. Even if there's a frame or two between the blocking events, input events can queue up and still cause an ANR. So want to be able to detect slow events that occur within a time threshold of each other.

Sign In or Register to comment.