user538626
user538626

Reputation: 911

Alternative for System.out.print in Android

Could someone tell me what is the alternative for System.out.print in Android?

Upvotes: 1

Views: 23042

Answers (6)

Codeversed
Codeversed

Reputation: 9473

private static final String TAG = YourActivity.class.getSimpleName();

// Prints a string followed by a newline
System.out.println(TAG + " " + VARIABLE);

Upvotes: 1

Pintu
Pintu

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

RoflcoptrException
RoflcoptrException

Reputation: 52239

You can also use System.out.println(). You will see the output in the Logcat.

Upvotes: 5

Sotiris Falieris
Sotiris Falieris

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

Cristian
Cristian

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

polopok
polopok

Reputation: 1

System.out.print
System.output.print
System.out.echo

Upvotes: 0

Related Questions