Even explicitly writing e.printStackTrace() it doesn't print to the console, why?
+4
A:
Checkout Logcat
in DDMS perspective it should be there not in the Console tab.
Or use the ddms
command tool to read logcat.
Pentium10
2010-07-06 19:50:56
with the ddms it will print to the console, like in the plain old java development?
Tom Brito
2010-07-06 19:57:19
No, never will print to the console.
Pentium10
2010-07-06 20:00:49
If you're testing on hardware, there's a free app (aLogcat) that works pretty well for viewing the logs of your phone without having to be attached to DDMS.
kiswa
2010-07-06 20:02:05
@Tom Brito: "with the ddms it will print to the console, like in the plain old java development?" No, no more than running a Java GUI on a remote machine will print to your local machine's console in "plain old java development". Remember: your phone and your development PC are two distinct pieces of hardware. There is a LogCat tab in Eclipse (shown above), or a standalone DDMS. If you absolutely need to see LogCat output in a terminal window somewhere, use `adb logcat`. And consider using `android.util.Log` instead of `printStackTrace()`.
CommonsWare
2010-07-06 20:02:32
+1
A:
printStackTrace() doesn't print to the console, it prints to the standard error stream. If you want to print to the screen, set your display text to e.getMessage() or e.getStackTrace(). (Although I do recommend learning to debug with logcat instead.)
Bill the Lizard
2010-07-06 20:00:54
+1
A:
use Log.X() where X is the type of error console you want(Log.e, Log.v, Log.d, etc.)
Nicholas
2010-07-06 20:37:14