How to Integrate Firebase Crashlytics Android Application

March 14, 2018 0 Comments

Get started with Firebase Crashlytics

Firebase Crashlytics can work with the very little setup on your part—as soon as you add the SDK, Crashlytics gets to work sending crash reports to the Firebase console.

Google INTEGRATION UNDERSTANDING:

To get started with Firebase Crashlytics, you need an app with Firebase enabled.

  • Click Tools > Firebase to open the Assistant window.

  • Click to expand one of the listed features (for example, Analytics), then click the provided tutorial link (for example, Log an Analytics event).

  • Click the Connect to Firebase button to connect to Firebase and add the necessary code to your app.


 

 Enabled Firebase in android app

Add the Crashlytics SDK to your project






1.Add the Crashlytics repositories and dependency to your project-level build.gradle file:

2.Add the Crashlytics dependencies to your app-level build.gradle:





For more fine-grained control of your crash reports, customize your Crashlytics SDK configuration. For example, you can add logs to track down pesky bugs, and more.

1.Retracing a user’s steps with logs






If I’m lucky, I may be able to look at the stack trace, see the line of code that crashed, and know exactly how to fix that.But If I don’t, I’m going to want to reproduce that crash.The great way to retrace a user’s steps is with custom logs.So from the issue Detail Page ,you can see the Logs tab and diving into that.

On Android, use Crashlytics.log to help pinpoint issues.

Crashlytics.log can write logs to a crash report and with Log.println(), or just to the next crash report:

  • Crash report and Log.println:




  • Crash report only:



Crashlytics limits logs to 64kB. Crashlytics deletes older log entries if a session’s logs go over that limit.

2.Finding Contextual cues with keys






Sometimes it’s not just about the order of operations that causes the crash.It’s actually the context that the user is in.You could imagine, maybe it’s the size of the file they have that they’re trying to upload maybe it’s how many items they have in their shopping cart, the level they are on a game.So here’s an example where I’m recording the key value.

Re-setting a key updates its value, for example:


Crashlytics supports a maximum of 64 key/value pairs. Once you reach this threshold, additional values are not saved. Each key/value pair can be up to 1 kB in size.


Log non-fatal exceptions






Crashlytics lets you log non-fatal exceptions.On Android, that means you can log caught exceptions in your app’s catch blocks:

All logged exceptions appear as non-fatal issues in the Firebase console. The issue summary contains all the state information you normally get from crashes, along with breakdowns by Android version and hardware device.

Crashlytics processes exceptions on a dedicated background thread, so the performance impact to your app is minimal. To reduce your users’ network traffic, Crashlytics batches logged exceptions together and sends them the next time the app launches.

Crashlytics only stores the most recent 8 exceptions in a given app session. If your app throws more than 8 exceptions in a session, older exceptions are lost.

Set user IDs






To diagnose an issue, it’s often helpful to know which of your users experienced a given crash. Crashlytics includes a way to anonymously identify users in your crash reports.

To add user IDs to your reports, assign each user a unique identifier in the form of an ID number, token, or hashed value:

If you need to clear a user identifier after you set it, reset the value to a blank string.

So these are a few tips with Crashlytics and how you can get the most out of crash reporting.

Contributer

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments:

Popular Posts