Android Best Logging Practices

What are the best registration methods for Android apps in production mode, given the following requirements:

  • Ability to load debug logs

  • Ability to clear logs or tilt settings

thank

+47
android logging
Oct 29 '10 at 8:59
source share
3 answers

We prefer to automatically load exceptions only. For customer logging, we prefer to selectively set the flag or have a special debug version that we provide to clients with problems.

Exception catching can be done using Thread. setDefaultUncaughtExceptionHandler (). There are some caveats with this (basically you need to exit () the application after doing exception handling). See: http://groups.google.com/group/android-developers/browse_thread/thread/c32e8c6120bed5c5/54c28b745c0fca80

For a log collection see android-log-collector . No need to use the whole package, see Source and copy-paste.

+7
Oct 29 '10 at 9:42 on
source share

If you want to get ACRA crash reports, this might be a good solution. ACRA is a library that allows an Android application to automatically publish crash reports in the form of GoogleDoc.

+4
Oct 29 '10 at 10:44
source share

To make the message more complete .. Google built-in crash reporting service in the new version of Android. For older versions where this is not yet supported, several services are available. Among those already mentioned, I would recommend these two:

  • ACRA ( Crash reports - several reporting options selected by the developer and / or user)
  • HockeyApp ( Testing / Report Failure Web platform with library support. Paid version is worth it if ur serious developer. IOS support too)

However .. Most of these libraries will make your application a little β€œheavier,” but more importantly, using them requires an allowed Internet connection . If your application does not need the Internet for any other reason, it may be suspicious to the user why you need the Internet if it is not.

Final word: Try to use as much as possible the Google service already provided for Android through third-party libraries.

Greetings;)

+2
Apr 03 '12 at 10:01
source share



All Articles