Replace default dialog with Custom Screen

Handling Uncaught-Exceptions in Android

Get convenient ways to handle uncaught exceptions for developers and testers.

Rohit Surwase
Published in
4 min readApr 22, 2018

--

TL;DR
UCE-Handler, an Android library helps you (developers, testers or users) to share the details of the uncaught-crash while you were using/testing the app during its development. The generated crash-log contains device info, OS info, exception-cause and track of all activities so the developers can work on it effectively. You can copy, share, view, email, and even save that crash-log to a file with just a click.

(Note: If you are in hurry, you can skip this big paragraph.)
It’s a beautiful day, Monday, you really enjoyed last the weekend. Now you are ready to start your week with a joy. You had been working on a feature for last few days, after testing it thoroughly you had given that APK for testing, last week. Today, testing team gonna test it, gonna try to break it. You are pretty confident that there will not be any issues remaining. The half-day passed and suddenly…
“Hey! the app is just crashed. Can you please check the log?”, John says standing next to you. And then as always you grab his mobile, connect it and get logs from it. Sometimes you even have to save those logs to a file if you are already working on something else. This whole process is very inconvenient for both of you, right?
Now you would say that you have added tools to report these uncaught-exceptions on the server, so you do not need to worry about it. That is okay, but do we really check those reports when the app is in development or say for the test version of the app? No, we do what we used to do, we copy logs manually.

Also check out the latest stories written by me:

Tracking down all exceptions is the crucial part of the development. We could just expect that we have handled all exceptions. But whatever we do, we come across it with the so-called pop-up saying “Unfortunately, App has stopped”, that is why it is called uncaught-exceptions.

I have been through this and I know the pain we all go through so I had decided to find a way out and luckily I got one or say I created one. I have developed an Android library which replaces the default pop-up with a custom screen which has some useful options. This custom screen lets you Copy, Share, View, Email, and Save the crash-logs to file. And on top of that these logs contain device info, OS info, crash-log and track of all activities the user has gone through. All this can be achieved with very few lines of code.

UCE-Handler is an Android library developed for developers like you and me which is also useful for testers. With this library, whenever your app gets crashed you will see a custom screen with useful options instead of the default dialog.

UCE-Handler library in action.

Cool! Right? Do you wanna have this library in your app? Yes! of course.
UCE-Handler library is open source and freely available GitHub.
You can check the GitHub page for simple steps to add it to your Android project.

If you like the article and library press the clap multiple times so as you came across it others could do. Share the library with your friends so even then can benefit from it.

Update 1: It is not at all an alternative for the Crashlytics or any similar tool but the thing is we use/check crash-reports from those tools only for production app. But with this library anyone can have a look at the crash log just after the moment it actually happens. No need to go here and there. So it is best suited for the test versions of the app.

If you like the article, clap clap clap 👏👏👏 as many times as you can. It inspires me to come up with more beautiful articles.
LIKED! Share on Facebook, LinkedIn, WhatsApp.

LIKED SO MUCH! Medium allows up to 50 claps.
Also post a Tweet on Twitter.

About: Rohit Surwase,
Techy by Birth. Writer by Hobby. Observer by Nature. Unpredictable by Character. Android Developer (Google Certified) by Profession.

Let’s be the friends on LinkedIn, Medium, Twitter and GitHub.

--

--

Rohit Surwase

Techie by Birth. Writer by Hobby. Observer by Nature. Unpredictable by Character. Android Developer (Google Certified) by Profession.