Getting started with HockeyApp for Xamarin.Android apps – Gather user feedback – Part 1

In previous post, I told you the first step in getting started with HockeyApp for Xamarin.Android – Collect crash report. With just one line of code you can collect crash report then send to HockeyApp portal while it can be a tremendous task if you use other libraries. Now in this post, I will tell you about the next step in working with HockeyApp. It’s about gathering user feedback and it’s very simple also.

HockeyApp provides two ways to gather user feedback. One is in-app feedback, the other can be done via HockeyApp portal. With the first one, you need to add a button somewhere in the app, add a few lines of code then your user can start to send feedback. I’ll go through the steps to add in-app feedback first then I’ll show you how to add feedback via HockeyApp web portal in the other post.

Let’s continue with the project I used in previous post.

The first thing we need to do, as I said above, is adding a button to the app

Update the MainActivity.cs to open feedback activity when you click the button

Now let’s run the app and tap the Feedback button. HockeyApp find that it’s the first time you send feedback and open the form to enter the feedback

Just enter feedback then tap Send Feedback, it will be sent to HockeyApp portal.

On HockeyApp portal, as a developer, you can view

and reply user feedback

When user open feedback activity in the app, she can view your response

and also can reply to you

As you can see, as simple as in previous post, you can add in-app feedback feature to your Xamarin.Android app. It will provide an effective communication channel between you and your user to help to gather feedback to add new features/improve/fix bugs. In the next post I will tell you about distribute your app to users and gather feedback from HockeyApp web portal.

Getting started with HockeyApp for Xamarin.Android apps – Collect crash report

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 😀

How to fix “Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]”

It happened to me a few days ago. The problem was caused by using different versions of Android SDK build tool to build Xamarin.Android apps (at home I’m using v24.0.1 while at the office I’m using v23.0.3). It can be fixed by uninstalling the app manually (if it shows in application list) or re-building the app with the last Android SDK build tool you used then uninstall it manually (as the app is uninstalled improperly, it still in your device but doesn’t show up in application list). After that you can build with the other build tool.

But in the worst case the app doesn’t show up on your application list and you don’t want to waste your time to install the other build tool to just buid it to uninstall, the adb tool will be the rescuer if you follow below steps:

  1. Plug your device into your computer (Make sure you enabled Developer mode first).
  2. From command line, you enter “adb devices”. It should list all the “devices” (included emulators) are connected to your computer.
  3. Run “adb -s {DEVICE_ID} uninstall {APP_PACKAGE_NAME}” with {DEVICE_ID} is the device’s id you can get from second step and {APP_PACKAGE_NAME} is application package name.

adb tool will uninstall the app then you can build your app with new build tool.

2 ways to resolve Unsupported major.minor version 52.0 when building Xamarin.Android app

After reinstalling Windows 10 on my PC, I also update the Android SDK Build-tools to lastest version (24.0.1 at this time) and I cannot build Xamarin.Android app successful as Visual Studio shows me an error message “Unsupported major.minor version 52.0”. Googling about it, I found that it is compatible problem of JDK and Android SDK with version 52.0 means it relates to JDK 8

To resolve this problem, there are 2 ways to do it.

Upgrade to JDK 8: I prefer this way as on Windows 10 64-bit, Android Studio will run 64-bit version by default and it cannot use JDK 7 32-bit which is installed together with Visual Studio 2015. So I download JDK 8 64-bit, install it then update Xamarin configuration

VS Configuration

Stick with JDK 7: You need to uninstall Android SDK Build-tools version 24.x.x and install version 23.0.3 (if you didn’t it yet)

Android SDK