Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>By default, the Android system redirects <code>stdout</code> (<code>System.out</code>) output to <code>/dev/null</code>, which means your messages are lost.</p> <p>Instead, the common pattern to log debug strings in Android is the following</p> <pre><code>import android.util.Log; </code></pre> <p>Then at the top of your class <code>YourClass</code></p> <pre><code>private static final String TAG = YourClass.class.getSimpleName(); </code></pre> <p>And to log debug strings you need to call</p> <pre><code>Log.d(TAG, "your debug text here"); </code></pre> <p>which in your case results in</p> <pre><code>package com.test1.nus; import android.util.Log; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final String TAG = MainActivity.class.getSimpleName(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.d(TAG, "Hello"); .... } </code></pre> <p>Finally you can see your debug strings in Eclipse via</p> <p><code>Windows &gt; Show view &gt; Other</code> and select <code>LogCat</code></p> <p>and if required filter by the tag of <code>YourClass</code>.</p> <p>However, if you really need to see messages written by <code>System.out.println</code> you need to tell Android to route them to logcat via the following shell commands</p> <pre><code>$ adb shell stop $ adb shell setprop log.redirect-stdio true $ adb shell start </code></pre> <p>and then you will be able to see your debug messages in Eclipse via LogCat view and the tag <code>stdout</code>.</p> <p>You can get more details from the official documentation here <a href="http://developer.android.com/tools/debugging/debugging-log.html" rel="nofollow">http://developer.android.com/tools/debugging/debugging-log.html</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload