Reputation: 911
Could someone tell me what is the alternative for System.out.print
in Android?
Upvotes: 1
Views: 23042
Reputation: 9473
private static final String TAG = YourActivity.class.getSimpleName();
// Prints a string followed by a newline
System.out.println(TAG + " " + VARIABLE);
Upvotes: 1
Reputation: 369
you can use logcat window in eclipse Window menu -> Show View -> Other -> find LogCat And see all output Either you write system.out.println() or Log.i()...
Upvotes: 2
Reputation: 52239
You can also use System.out.println()
. You will see the output in the Logcat.
Upvotes: 5
Reputation: 940
@polopok Hm... Not that correct I think.
Check the code guidelines : http://source.android.com/source/code-style.html#logging
Log.d(), Log.i(), Log.w(), etc should be the way to go.
Upvotes: 0
Reputation: 200120
Log.d("SOMETHING", "Content");
The d
above is for debug messages, but you can also use with i
for information messages and e
for error messages (and v
for verbose). Now you may think... how do I see that output? well, you use the logcat
which is a tool inside the SDK. If you use eclipse and the ADT plugins, you can see the logcat
output from there.
Upvotes: 11