Google ANR Analyzer for Xamarin apps

JassimRahmaJassimRahma USMember ✭✭✭✭

Hi,

As you know that the current Google ANT=R available on Google Play Console is as of no use when developing Xamarin apps because it doesn't tell where is the issue, which page and what control?

I also tried Firebase but it's the same and Microsoft App Center don't have this feature yet as confirmed by the team.

Is there any good analyzer to use with Xamarin to identify the ANR issue?

Thanks,
Jassim

Answers

  • JohnHardmanJohnHardman GBUniversity mod

    @JassimRahma -

    Various options:

    If using HockeyApp on Android, you can use HockeyApp.Android.FeedbackManager.ShowFeedbackActivity to get the user to enter details of what they had been doing at the time of the Application Not Responding.

    If using App Center, you can construct a similar mechanism using Crashes.HasCrashedInLastSessionAsync() . See https://docs.microsoft.com/en-us/appcenter/sdk/crashes/xamarin

    Additionally, you can monitor what functionality has been started and which functionality has completed. If you do this, you can attach the information about functionality that started but that did not complete to the feedback sent using the method above. You can implement that monitoring on the device, just writing to persisted storage each time functionality is started, and removing the information about that functionality when it completes. The Xamarin.Forms Application.Current.Properties should be adequate for that, although it has historically had some issues.

    If you don't want to construct a feedback UI, you can simply use Crashes.HasCrashedInLastSessionAsync() together with the information about what functionality started but did not complete, and send the information using Analytics.TrackEvent

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    @JohnHardman I tried App Center's HasCrashedInLastSessionAsync but it doesn't cache ANR.. I guess it's not considered Error for them. I asked the App Center team who confirmed App Center does not any log for ANR and it's in their list for future releases.

  • JohnHardmanJohnHardman GBUniversity mod

    @JassimRahma said:
    @JohnHardman I tried App Center's HasCrashedInLastSessionAsync but it doesn't cache ANR.. I guess it's not considered Error for them. I asked the App Center team who confirmed App Center does not any log for ANR and it's in their list for future releases.

    That's surprising, although so far neither HockeyApp nor App Center have been as useful in some respects as Xamarin.Insights was. However, you can still record entry and exit from particular pieces of functionality, and where an entry is recorded without an exit, report that back via TrackEvent. If you use that same information on startup of the app to prompt the user for information about what they were doing when the app closed, that would provide even more useful information.

  • iamaasim23iamaasim23 Member ✭✭

    hey @JohnHardman what solution you got for your problem

  • JohnHardmanJohnHardman GBUniversity mod

    @iamaasim23 said:
    hey @JohnHardman what solution you got for your problem

    I think you meant to address this to @JassimRahma

  • iamaasim23iamaasim23 Member ✭✭

    ya sorry for that @JohnHardman.
    @JassimRahma ?

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    @iamaasim23 none

    However, as @JohnHardman said you can get some idea about it using TrackEvent or TrackErrors from AppCenter

Sign In or Register to comment.