How to integrate HockeyApp with Xamarin Android
by Virendra Thakur 7th March 2017.
Developers are facing a lot of challenges in delivering high quality mobile apps quickly. The absence of proper infrastructure support, beta testing, user feedback and crash reports has furthermore complicated this situation. To overcome all the challenges, HockeyApp was introduced as it provides comprehensive services to manage mobile apps through all phases of development. It supports the ability to boost the application quality and manage mobile apps in a variety of ways. HockeyApp offers Native Support, Cross-Platform Plugins and Open Source SDKs for Xamarin, Unity and Cordova.
Let’s take a walk through the key features of HockeyApp:
- Distribution – Developers can upload beta versions of a mobile app to HockeyApp for the testers to install the app directly on their mobile device. This eliminates the need to site-load apps manually and makes distribution easy. Users are also notified about the latest version update.
- Crash reporting - Integrate industry-leading crash reporting feature to gather the most accurate stack traces. A crash report consists of class names, accurate line numbers, message and minute details of a device that encounters a crash. These rich crash reports can be generated during development and testing or for the apps released in the app store.
- Feedback – HockeyApp provides an in-built form to capture feedback from the testers or end users via web form, email or directly from the app. This form can help enterprises gain a deep understanding of how users are utilizing an app. User can also attach screenshots while submitting a feedback form.
- User Metrics – This feature helps an enterprise gain deep insights on user behaviour that can help improve user experience. The analytics performed upon the daily active users, new users and monthly active users can help one track & measure customer engagement, improving app reliability as well as providing information about impacted users.
- Team – HockeyApp offers team-management feature that helps one distribute applications to various sets of test users quickly and simply. One can organize teams, grant access with roles, define set of owners at organization level. This feature allows developers to upload & edit the basic app data, testers to download & install the app and members to view and send feedback.
Here are the steps to integrate HockeyApp with Xamarin Android app development framework.
- Open your application in Visual Studio and add the HockeyApp nuget package from nuget manager.
- Now Sign up to Hockey App (https://devblogs.microsoft.com/appcenter/hockeyapp-is-being-retired) and login to the portal. Once you log in, click New App button. A landing page opens as shown in the image below, select Create the app manually instead.
- In the Create App landing page, select Platform as Android, Release Type as beta and enter Title as shown in the below image.
- To enter the Package Name, go to your Solution in Visual Studio and open the properties of Android Project. Copy the Package name from Android Manifest tab, as shown in below image and paste in the Package Name field of Create App page and click Save.
- The below landing page appears that displays your App tittle and App ID. Copy the App ID for your future reference.
- Go to your Main Activity and add the below code to consume HockeyApp features through a unique app id. User can track the activities through this unique id.
- Use the below code related to Crash Manager, Update Manager and Events in the main activity to register the features. Also, add the Track Event code to enable event tracking functionality for the page.
- Use the code for Feedback Manger to register the Feedback manager functionality in your existing code.
- To Track the Events, we need to start and stop the Tracking activity. For this, use the following code in your main activity code.
In addition, you can check all the events tracked in last 30 Days under the Events tab in the HockeyApp portal. All the details such as Event Count, Unique Users count and unique Users of every event can be viewed in this section as shown below.
To run and check how the Crash Reporting feature is works:
- Add the below code to create a sample view of Crash App button to check how this functionality works.
- Run the application & click the Crash App button and the app will Crash. Now, open the app and you will see a dialog box like below image. Click SEND REPORT.
- Now log in to Hockey App Portal and select Crashes tab.
- Select any Exception from the list and you can find the Managed Trace, Devices and OS Versions buttons to check its detailed report.
To run and check how the User Feedback feature works:
- Place the below code to create a sample view of User Feedback button to check how this functionality works.
- Run the application & click the FEEDBACK button (on the screen as shown in the step 2 above) Fill the form and add attachment, if any. Click SEND FEEDBACK. You can view the submitted form in the Hockey App portal under the Feedback Tab.
To deploy the app on HockeyApp portal, follow these simple steps:
- Create a Release Build from Visual Studio
- Go to Hockey App Portal and select your app and click Add Version
- Upload the Build, add the Release Note if you have. All the Events, Crashes, Feedback, Users and Versions can be captured now on the Portal.