Crashlytics for Android apps

Hello Android Developers,

We always want to build an amazing app for our users, but due to tight release cycles or lack of enough testing ended up with an app which crash unexpectedly and not able to figure out exact bug or reason of crash. To solve this problem there are several crash reporting tools available which gives us enough insight of performance and bugs lies within our apps. Out of all I feel Crashlytics is the best in the market till date –

Crashlytics For Android Apps

This is by far the best crash reporting tool I have ever used. Now it is part of mobile development kit provided by Twitter called Fabric

You just need to install the Fabric plugin from Android Studio and after that need to login and you are ready with Crashlytics.

Your next step is to just add the Crashlytics gradle library in your project.

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
        transitive = true;
    }
}

Once after adding the library need to initialize Crashlytics to capture the crashes with some other information related to the crash scenario.

Fabric.with(this, new Crashlytics());

It is recommended to initialize it either in the Splash screen or onCreate() method of custom application class of your android app.

Once initialization is done, your app is ready with crash reporting feature and you can test it. Every time your app will crash this tool will shoot a mail about the details of the crash to all the added team members for that app.

 

Crashlytics will even gives you option to report about additional information by passing those data in key value pair,  and it will report according to the mentioned Keys. To implement it just need to use the following lines of code within your app.

private void setupCrashlytics() {
       Crashlytics.getInstance().core.setUserIdentifier(user.getUserId();
       Crashlytics.getInstance().core.setUserName(user.getName());
       Crashlytics.getInstance().core.setUserEmail(user.getEmailId());
       Crashlytics.getInstance().core.setString("Locale", user.getLocale());
       Crashlytics.getInstance().core.setInt("UserId", user.getUserId());
       Crashlytics.getInstance().core.setString("OS", Build.VERSION.RELEASE);
       Crashlytics.getInstance().core.setString("Phone-Model", Build.MODEL);
       Crashlytics.getInstance().core.setString("Phone-Manufacturer", Build.MANUFACTURER);
       Crashlytics.getInstance().core.setString("Phone-Brand", Build.BRAND);
   }

This is a sample code to send some app specific data, so you can use it in your way.

Though Crashlytics for Android apps is only giving crash reporting option but you have other tools inside Fabric kit like Answers for analytics and beta for beta testing of your app but these tools need separate post to cover all aspects.

 

Let me summarize why you should use Crashlytics for Android apps –

  • Lightweight Sdk
  • Free to use
  • packed with analytics and beta testing tools
  • Easy to configure
  • Backed by Twitter

I hope this will give you all enough insight of Crashlytics.

 

Please do share this post and subscribe to get more informative posts.

Happy coding!!!

 

Leave a Reply

Your email address will not be published. Required fields are marked *