tags:

views:

123

answers:

4

In Android, what is the best way to write to the console. In C# I'd use either Log4Net or just Console.Write

+2  A: 

For simple debugging, the standard Java way suffices:

System.out.println("Message");
Dan Dyer
+1  A: 
aioobe
+8  A: 

Check out the help pages for Android.Util.Log.

You can use:

Log.v("MyActivity", "Verbose output");
Log.d("MyActivity", "Debug output");
Log.e("MyActivity", "Error output");
Log.i("MyActivity", "Information output");
Log.w("MyActivity", "Warning output");
Log.wtf("MyActivity", "WTF output"); // This isn't a joke :)
Mark Ingram
Seriously not a joke - wtf: What a Terrible Failure
Fernando
+1  A: 

You need to learn how to Debug in Eclipse and how to use the ADB and DDMS tools.

In order to get more details about an exception/force close you need to look for a view in Eclipse called Logcat(you will find in the DDMS perspective) there you will find a detailed traceback when/what and on what line is the issue.

For this you should read a complete article about Debugging in Android using Eclipse

alt text

Pentium10