Devlog Week 2 – App Analytics

You’ve just launched your new app to the Play / App store and the downloads are ticking over. Everything is going great; Your app is climbing the charts, positive user reviews and feedback, until you get a 1-star review with the incredibly informative title:

crashed when I opened – won’t work!

What caused it? Why did it happen? Was it the user or an edge case that wasn’t tested? And now with Marshmallow allowing permissions to be turned on or off, developers can have a hard time figuring out the ongoing problems in apps. Thankfully there are countless offerings for analytics tools specifically for apps and the functionality provided is steadily increasing lately.

I won’t go through all of the offerings available, but if you’re using Azure like me for your server web logic, then an Application Insights tool is useful for monitoring the back-end (if it is a Web API or similar .NET project) Microsoft purchased HockeyApp over a year ago and I have seen mentions about integrating it with Application Insights but I had a need for something else. As I already had Facebook authentication for my app, I wanted to integrate Twitter too to provide a choice between the primary networks. It just so happens that Twitter released their own mobile analytics tool called Fabric not too long ago, so I tried to kill 2 birds with 1 stone.

Fabric turned out to a great tool, I would definitely recommend the Fabric for Android Studio plugin which provides some basic code snippets for different features, all bundled into a cosy window! Twitter authentication took ~5 minutes with Fabric, and Answers/Crashlytics (Fabric’s Crash Analytics tool and regular usage analytics) took roughly the same amount. To get going once you’ve installed the plugin & dependencies, it all starts with a simple 1 line of code in your starting activity

TwitterAuthConfig authConfig = new TwitterAuthConfig("API_KEY", "SECRET_KEY");
Fabric.with(getApplicationContext(), new Crashlytics(), new Twitter(authConfig));

In my case, I was using both Crashlytics and TwitterAuthConfig, used for the TwitterLoginButton. Instead of using multiple Fabric.with commands, the ‘kits’ can be chained together into a single declaration. Fabric has a pretty good guide to get setup, and there’s no major complexity to it. Once it’s working, you’ll be able to view any crashes in your app that happen on any device, including a stack trace, activity details, time / date, memory and storage usage at the time of the crash, orientation, device type, device Android version, and on and on. It’s a very sophisticated tool that offers everything from Phone Number login (called Digits) to Stripe payments and Mobile Advertisements, offering something for everyone. I have yet to try Google Analytics for Mobile so it will be interesting to see the differences between the two.

I think for the majority of users the Answers and Crashlytics kits from Fabric are the most interesting, especially Answers’ Events which fire off based on particular actions in your app. Fabric provides some pre-built useful Events such as Logging in, Signing up, Completing a level etc. but custom events can be easily made too. After a week of using it I am very impressed with the features included, and I would definitely recommend it to anyone developing a mobile app.