O'Reilly logo

Hello, Android, 4th Edition by Ed Burnette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Debugging

If you’ve been programming for any length of time, you know that some (most?) of the time, things don’t go the way you expect. What do you do then? Luckily, the same techniques you use to diagnose problems on other platforms can be applied to Android. These include printing messages to the log and stepping through your program in a debugger.

Debugging with Log Messages

The class provides several static methods to print messages of various severity levels to the Android system log:

  • Log.e: Errors

  • Log.w: Warnings

  • Log.i: Information

  • Log.d: Debugging

  • Log.v: Verbose

  • Log.wtf: What a Terrible Failure

Users will never see the system log, but as a developer you can view it in a couple of ways. In Android Studio, the LogCat view is shown at ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required