Android Basics – How to Add Log to your Class for Debug Purpose

Using Log statements in your Android Project is both useful and important. It will help you to debug problems.

 

The following Log levels are available in Android

  • Debug
  • Verbose
  • Error
  • Warn
  • Info
  • Error
  • Assert

To add a Log statement to your MainActivity Class simply add the following code statement to the onCreate method.

Log.v(MainActivity.class.getSimpleName(), “In onCreate”);

 

Author: codesmartly

I am Enthusiastic about Learning new things and sharing my Knowledge. I like programming and have a pretty good background in Computer Science.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s