1. Check out our companion app, Forums for Android! Download from Google Play

better way to get crash data

Discussion in 'Application Development' started by guzba, Dec 8, 2011.

  1. guzba

    guzba New Member
    Thread Starter

    Mar 2, 2010
    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.)



Share This Page