Your app crashes, live with it.


Let’s say that you are a developer that actually cares about the quality of his applications, yes, you belong to the 1%, so you are using BugSense to catch all the exceptions and you get something like this:

Full Stacktrace
0 android.database.sqlite.SQLiteDiskIOException: error code 10: disk I/O error
1 at android.database.sqlite.SQLiteStatement.native_execute(Native Method)
2 at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:55)
3 at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1881)
4 at android.webkit.WebViewDatabase.removeCache(WebViewDatabase.java:668)
5 at android.webkit.CacheManager.createCacheFile(CacheManager.java:430)
6 at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:134)
7 at android.os.Handler.dispatchMessage(Handler.java:99)
8 at android.os.Looper.loop(Looper.java:123)
9 at android.os.HandlerThread.run(HandlerThread.java:60)

You’re trying to figure out what is happening, how can this be your fault, especially when you are absolutely sure that you are not using SQLite in your project!
Well, I have good news for you, it’s not your fault, but then again I have bad news for you, even if you have done serious testing, shit happens and your application is going to crash, no matter what. And I mean it. It is going to crash. Even Gmail or Facebook crashes!

Trying to catch every possibility or corner case may lead to a large and complicated source code, leading to even more crashes. General exception handling on the other side will make your application slow, so make sure you keep the balance on this.

You cannot predict what the user will do, you cannot predict the behavior of the devices out there and allow me to make it more clear with 2 examples:

The Huawei IDEOS X5 constantly crashes with random Resources NotFound Exceptions.
The Sony Ericsson X10 mini simply does not run apps, they do not even start sometimes.

The list goes on and you must accept that your application will crash, what you can do is minimize the crashes that are your fault.

Your app crashes, live with it.

(Image from Wired.com)

Share

[ACRA] Application Crash reporter lib

AndroidBlogger posts a very useful library for crash reporting named ACRA.

Read the post here

Check out the project’s site here

The advantages of ACRA are:
* You don’t have to develop your own server side solution, it’s all done by google. You don’t even need a web server. A google login is enough !
* All crash reports are sent. Nivek made it modular so you can choose how you inform the user that a crash was send ( no feedback, toast feedback, feedback as a notification )
* it’s soooo easy to use !
* It’s working with every Android version
* You still can add your own custom informations
* You can use it to send information even when there is no crash ( for instance if your code is in a strange state, but you manage to catch the problem, and put it back in a stable state. You may still be interested by what bring this strange state in the first place ).
* You can receive a mail each time the google doc has changed ( so each time a new bug arrived ), or in a daily digest form (that’s what I’m using ).
* Lastly, and this is something I didn’t have time to investigate, but I’m sure is _really_ powerful, you can use all the power of Google doc to use the information and present it in any useful way you want.

Share