Click here to Skip to main content
11,640,125 members (66,834 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Java
Android. I used:
import android.util.*;
Log.d("MyActivity", "Debug output");
but this not show anything in console. What else may I use?
Posted 13-Nov-12 2:49am
Edited 13-Nov-12 2:50am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to look into doing standard IO with java.
There are System.out and System.err please read about them here: Java IO:, System.out, and System.err[^].

    System.out.println("Debug output");

I found this bit on SO where it says in one solution that in android System.out and System.err are redirected to /dev/null, effectively sending all your output into nirvana. Please read the details on SO: Is there a way to print to the console in an Android app?[^]

There is also an promising link sending you to this site:[^]
[End Modificiation]


— Manfred
halabella at 13-Nov-12 9:34am
Thanks, tried, but its don't works for me, and I don't know why...
Manfred R. Bihy at 13-Nov-12 9:45am
What exactly do you mean by "console". It looks as if this is an android application so what console exactly are you talking about?
Manfred R. Bihy at 13-Nov-12 9:52am
I modified my solution as I found some relevant information about standard IO redirection on android.
Please see the modifications.

halabella at 13-Nov-12 9:52am
Console what I see in Eclipse.
lewax00 at 13-Nov-12 10:28am
Open the Logcat window in Eclipse and you will see it, if you don't, change your filter level on Logcat (I don't remember how off the top of my head, but if you Google for "logcat eclipse" you should find some information).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100