Skip to content Skip to sidebar Skip to footer

Automated Android Crash Reports with ACRA and Cloudant

Automated Android Crash Reports with ACRA and Cloudant

Making a basic Android app is easy. But making it reliable, scalable, and robust, on the other hand, can be quite challenging. With thousands of available devices pumped out from tons of different manufacturers, assuming that a single piece of code will work reliably across phones is naive at best. Segmentation is the greatest tradeoff for having an open platform, and we pay the price in the currency of code maintenance, which continues long after the app passes the production stage.

In this post, we’ll walk through a solution: automated crash reporting with ACRA and a Cloudant back-end, all visualizable with acralyzer.

Making a basic Android app is easy. Making a reliable, scalable, and robust Android app, on the other hand, can be quite challenging.

Segmentation is the greatest tradeoff for having an open platform, and we pay the price in the currency of code maintenance, which continues long after an app has passed the production stage.

Creative approach to every project

So, what happens when an Android app crashes or becomes non-responsive? Well, the “Force Close” dialog pops up, letting the user know that something’s gone wrong. If the app was downloaded through Google Play, the user will be prompted to report the crash by sending a detailed Android crash report (including time, phone model, Android version, stack trace, etc.) that you (the developer) can view in the the Developer’s Console, allowing you to address the culprit bug.

This all sound very nice—but there’s a major problem with Android’s default error reporting: users tend not to use it, leaving developers clueless as to the state of their apps.

This all sound very nice—but there’s a major problem with using Android’s default error reporting: users tend not to take action when their apps crash; in fact, the majority choose not to send in Android error reports. How then, can you, as a conscientious developer, gain reliable insights into your app’s crashes and failings?

Introducing ACRA

ACRA stands for “Automated Crash Reporting for Android”. It’s a free library that lets you solve the ‘manual error reporting’ problem with a few lines of code. Once you’ve implemented the library and everything has been properly initialized, you’ll be able to extract the same Android error logs as the Google default (plus a bunch of added customization options) automatically and without requiring the user to take action.

Beyond that, ACRA lets you choose how you’d like to inform the user of an Android crash, with the default being silent background reporting, and alternatives including customized dialogs.

Until recently, ACRA was backed by Google Spreadsheet, which meant that you were able to receive all your reports in a single file, hosted for free on your Google Drive account. Unfortunately, Google requested that we not use this option in the future, so we’re left with a couple of alternatives for sending in crash report data, some of which we will cover in this tutorial:

  • Standard email (still requires user interaction).
  • Custom email/HTTP client (requires extensive setup).
  • Custom back-end (with options ranging from free to commercial solutions).

In this article, we’ll analyze one of these solutions: hosting your ACRA reports on a Cloudant back-end and visualizing the data with acralyzer.

Share on facebook
Facebook
Share on whatsapp
WhatsApp
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest

Leave a comment