Why it exists
There is currently no way for an android application to catch and report ANR errors. If your application is not in the play store (either because you are still developing it or because you are distributing it differently), the only way to investigate an ANR is to pull the file /data/anr/traces.txt.
What it does
It sets up a watchdog timer that will detect when the UI thread stops responding. When it does, it raises an error with the main thread's stack trace.