I instrumented Newton with the acra library today. Acra registers an UncaughtExceptionHandler (which is also available in desktop Java) and everytime your application crashes bad on a user’s device it send an error report with information such as android version, phone model plus stacktrace to a Google spreadsheet you set up for that purpose. The steps to include this in your application are totally easy:
- Create the Google spreadsheet as lined out in Arca’s Wiki
- Create a class that extends CrashReportApplication and implement the getFormId() Method, returning the form id you got from your spreadsheet
- add android:name=”YourCrashReportApplicationClass” to your AndroidManifest.xml file
- Crash Reports!
I especially like the solution of using Google spreadsheets for this kind of crash reporting. It also works on devices < 2.2 (down to 1.5) which is a definite plus. Finally you can add your own reports besides standard crash reports at any point in your application. With this feature you could for example log the average FPS of your game.
I used the standard crash reporting facilities of Acra and behold i got crash reports!
Now that is nasty. Gui widgets in Newton are initialized in a lazy fashion. If the user is fast enough i try to dispose something which has not been initialized yet.
I hereby fully recommend the use of Acra in your application! The code is solid and doesn’t do anything nasty (e.g. send your stats to a 3rd party).