Logo letter
Crash Analytics in Xamarin Forms App
almost 2 years ago
Xamarin_Form_Apps

1. Introduction:

In this blog, we are going to see how to get the crash analytics of the Xamarin Froms Application. Crash Analytics is allowing us to track the Exceptions, Events and behaviour of the application, it can be either Android and iOS., it is designed totrack the users, events and crashes of the application, crash analytics will capture all the data of your application and it will automaticallyhave synced with the server and within the few time it will be reflected on the respective portal. Analytics tools will help you to understand that howpeople are using your app, what is the point of crash and how you can improve your application.

 

There are different kind of Analytics tools are available in the market, each of them having different capabilities to capture analytics, some ofthem are paid and some of available free as well. Following are the list of various analytics tools,

  1. Google Analytics
  2. Flurry Analytics
  3. Mix Panel
  4. Raygun
  5. Amplitude etc.

2. Solution:

Here I am going to detailed explain about the Flurry analytics which is available free and easy to use, it also provides the effective data for analytics purpose,some of the advantage of the Flurry Analytics are as follow,

  1. Session tracking
  2. Event logging, with optional parameters
  3. Page View tracking
  4. Demographics tracking, such as age, gender and user id
  5. Location tracking
  6. App version tracking etc...

Getting started with the Xamarin Forms application, here are the steps to add flurry analytics in Xamarin Forms Application,

1. First of all you'll have to create an account on Flurry (it's Free) for creating account visit https://login.flurry.com/signup,complete all the registration steps and login in Flurry portal.

2. After logging in Choose the platform where you want to get the analytics, like as Android / iOS etc.

3. Now go to Applications tab and add the application Add Name and the Category of the application, then you will jump to the Application screen

Where you can see the Application key which is a unique key and it is used to identify your Application.

 

For more details, refer screenshot below

Flurry analytics is required separate key for each platform to get the analytics, it uses a unique key which is generated for each new application,

On each platform, so now we have to add the following code into your MainActivity before that you have to add the Flurry Nuget package in your solution as Add Flurry.Analytics.Portable in your Portable Project and Flurry.

4. Analytics in your Droid Project and now add following code into your MainActivity,

File: MainActivity.cs

            FlurryAgent.Init(Xamarin.Forms.Forms.Context, "Your_App_Key");             

FlurryAgent.OnStartSession(Xamarin.Forms.Forms.Context);                                  

FlurryAgent.SetLogEnabled(true);                                         

FlurryAgent.SetLogEvents(true);

 

5. Now we are done with the configuration for Android platform, so we can start logging error, exceptions and Events as,

  • For Errors:

                         AnalyticsApi.LogError("My Exception", ex); 

Note: Here My Exception is the name which you want log and ex is the exception object

  • For Events:

                         AnalyticsApi.LogEvent("My Event"); 

Here you can also bind the data in the Events as,

                        AnalyticsApi.LogEvent("My Event"+data);     

Note: Here My Event is Event name and data is string which you want to bind with your event.

You can log Events and Exceptions anywhere across the code,

  1. Views: login.xaml.cs
  2. ViewModel
  3. Repository (API calls)

6. So now we are done with the logging of exception and events from the application, new for the analytics we have to login to the Flurry portal,and select the application which you have created, on the application dashboard you can see various options some of them are marked in screenshotand details are as follow,

   1.Events: To get the events which you have logged. Here you will get some more options as,

  1. Event Summary
  2. User Paths
  3. Event Logs

2.Errors: To get the Erros and crashes, it also shows the excepitons which you have logged. It contais few options as well,

  1. Crashes
  2. Errors by Stack Trace
  3. Errors by Name

           

3. Users: Here you can get the user specific data.

4. All Versions: This filed shows the version specific data as you have released different versions.

5. Date Filter: It provide a date filer for specific date/time interval, you can also make it custom.

6. Download: Here you can download all the details in CSV file format.

 Just in case you have any question related to Xamarin Forms Application or app development, you can ask xamarin app development India experts. They will explain and share their best knowledge related to analytics tools used in the process.

3.    Conclusion:

Crash Analytics in any mobile technology will help organisation / developers to learn where the app gets used widely and where the users are facing issues, so this blog helper developers / organisation to understand how the application behaves when it’s used by the customer and analytics will provides the data which makes an application more optimised and bug free.

Posted in:Xamarin
Read Further
You don't have any news posts to display. Change widget configurations and/or add or manage news posts in the Blog section of the control panel.
Footer