As you may know, after acquring Xamarin, Microsoft is replacing Xamarin Insights by HockeyApp and they also continue to work on Nuget package (current in beta) to help developer to integrate HockeyApp into Xamarin apps. This serie will help you to get started to work with HockeyApp in Xamarin.Android apps.
What is HockeyApp? HockeyApp is a service which provides beta distribution, crash reporting, user metrics and feedback gathering for Android, iOS, Xamarin, Cordova, React Native,… It plays an important role in Microsoft’s complete mobile lifecycle solution.
HockeyApp provides a free tier which supports 2 apps but you can buy other plans which support more apps. You can find more about them here.
It’s enough for introduction. Let’s start.
After creating an account (it’s too easy) you can add new app to HockeyApp immediately
As you don’t have the app yet, let’s select “Create the app manually instead”
Please select Platform (Android in this cases) and Release Type, enter app’s title in Title text box and app’s package name in Package Name field (it must match your Xamarin.Android app’s package name) then click Save.
The app will be created and you need to copy App ID to use later in your code.
Now it’s time to create the app. Open Visual Studio, select Xamarin.Android Blank App template as below, enter app name and select location to save the app then click OK.
Next step, you need to add HockeyApp from NuGet
At this time HockeyApp library for Xamarin is still beta (v4.1.0 beta 3) so you need to select “Include prerelease” check box to get it
Open MainActivity.cs then clean up the code before add code to register CrashManager with the App ID you get in above step. You can also see that in the button’s Click event, I throw an exception to make the app crashes
When you run the app and tap the button, the app will crash immediately. Next time you open the app, it will ask you to send crash report. Just tap Send Report.
After sending the crash report, you will see it on HockeyApp portal as below.
As you can see, with just one line of code you integrated HockeyApp library into your app and collect the crash report from testers.
In next blog, I will guide you through the steps to gather feedback from users.
Happy crashing 😀