What does LogCat do in Eclipse?
How do I use it? I have never used the log cat before in Eclipse, so I don\'t understand.
You use LogCat by adding commands like this in your code:
Log.d(TAG, stringVar);
The TAG is a string constant that will help filter the output from LogCat. The TAG may be the name of your Activity or Application. You use the filter in the LogCat window to see only the filtered output.
String TAG = "AppName";
The stringVar can contain anything that may be helpful for your understanding of how the code works when you need to debug it,
An example is if you are unsure of the value of an int variable (f.ex. intVal): --- code --
String stringVar = " value of integer intVal = " + new Integer( intVal ).toString(); Log.d(TAG, stringVar); --- code end ---
LogCat is very useful. You can add the LogCat window in Eclipse by doing this "Window -> Show View -> Other -> Android -> Logcat"