Remotely log unhandled exceptions in your Android applications.
Download the latest trace.jar file found here. Drop it into your Android project and in the properties for your project add it to "Java Build Path" -> "Libraries".
In your android manifest, you must enable internet access for your application:
<uses-permission android:name="android.permission.INTERNET" />
In the onCreate method of your activity or in your service, you must call public static boolean register(Context context) found in the class ExceptionHandler. Do something like this:
The default implementation will post the stack trace to http://trace.nullwire.com.
If you would like to store your stack traces on your own server, you will have to register the exception handler like this:
At http://your.domain/path the client side implementation will expect to find this simple PHP script, which will take three POST parameters: 'package_name', 'package_version' and 'stacktrace'. The collected data is simply stored in a plain text file. You can extend the script to send you an email with the stack trace if you like - just uncomment the last line and change the email address.
The JAR may be built by issuing the following command:
This will produce a trace.jar file.
Cleaning up is done by:
If you have problems, feel free to drop me a mail at email@example.com.
How to integrate stack trace collection with Redmine: http://nullwire.com/capturing_android_exceptions_remotely.
Thanks to these people, who contributed with code changes and/or bug reports.
The MIT License
Copyright (c) 2009 Mads Kristiansen, Nullwire ApS
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.