How we reduced app crashes by 99%

Prashant
Internshala Tech
Published in
3 min readJan 26, 2021

Co-writer: Aseem Garg

Android app crash is not a recent issue. It has been with us since the launch of Android and has affected many users since then. It can be caused by hardware problems, cache data issue, poor code implementation or any other thing.

Why does an app crash?

An app is a simple software that allows you to perform specific tasks. These software are written using programming languages like Java and has thousands of lines of execution. Thus developer always needs to be on toes while developing an app as they cannot afford to miss use cases or fail to handle exceptions which may lead to a crash.

An app crash is a state where the OS terminates the app and displays a dialog informing users about the crash.

image src: google

Are crashes critical?

An app is built to deliver a product feature and a lot relies on how the app is interacting with the user. The app should not only be user friendly but also should meet the OS and device standard. Any unexpected exit while the user is online can be a very poor user experience and if not acknowledged then it can lead to poor app rating.

Higher the crash rate, poorer is the user experience

With growing crashes, users may tend to lose faith in the app which affects the play store rating and indirectly will restrict new users from downloading the app thus making app crash report very critical for developers.

There can be many reasons due to which an app can crashes. It can range from hardware issues like Memory, Storage to software issues like NullPointerException, RuntimeException, IndexOutOfBoundsException, etc and all these software errors or exceptions can be handled. The main concern for a developer is how to make sure that they are receiving the crash reports with sufficient details on time.

Customising crash logs

img src: lynda.com

If the app has crashed because of some generic error or exception then it is quite easy to debug and fix. But the biggest challenge for a developer is to debug edge cases or device-dependent issues. Even Firebase Crashlytics does not have enough data to replicate or analyse the crash report. In such scenarios, we used to set up a remote connection which is a time-consuming process. The only reason for us to have remote session was to observe user’s course of action and get few other details, and we realised that if we could get user data at the time of crash only then it would save us a lot of time and effort. On researching, we found ACRA(Application Crash Reports for Android)

ACRA is a library enabling Android applications to automatically post the crash reports to a remote server (REST API). It is targeted for android applications developers to help them get data from their applications when they crash or behave erroneously.

How it is helping us:

Above image shows the 30 days rolling average crashes occurred in our app starting from May’20, and there’s a major dip in crashes after we started using custom logs.

Since ACRA sends a report to our server using API, we started to receive crash logs with all the custom data. Now we can easily locate a particular crash log with the help of details and debug. It has brought down the crashes and now, we are having approximately 99.60% crash-free sessions.

If you liked the post or it somehow helped in your development process, Don’t forget to 👏 this article. Feel free to give feedback or suggestions.

--

--

Prashant
Internshala Tech

SDE - II @FloBiz | Ex-Internshala | Mentor @ hackCBS 2.0 | Full Stack Developer | Freelancer | Open-Source Contributer