better way to get crash data

Quickly share your Android Code Snippets here...

better way to get crash data

Postby Guzba » Thu Dec 08, 2011 7:14 am

I have seen a lot of different ways people have suggested for getting crash data from android applications. I've always found them hacky, like writing a file to disk then checking for it the next time the app is loaded. I've come up with a cleaner and more dependable way and put it up on Github.

Basically, I send an intent with the crash data to a service. This is a better solution than writing a file, for example, because when an app force closes, the process is terminated so you can't count on anything that will take any time, such as writing to disk or a network request. And, if all you did was write a file to check for next time, its possible they won't ever load the app again and you'll never get that report.

By sending an intent, your process will be restarted after being terminated so that the intent can be processed. Thus, you can report every exception right when it happened.

Thought you all might like to check it out and use it in your apps. (And if I dont tell anyone, no one will ever know about it.)
Once Poster
Once Poster
Posts: 1
Joined: Mon Mar 01, 2010 8:08 am


Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 3 guests