Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Android. I used:
Java
import android.util.*;
......
Log.d("MyActivity", "Debug output");

but this not show anything in console. What else may I use?
Posted
Updated 13-Nov-12 2:50am
v3

1 solution

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

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


[Modification]
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: http://developer.android.com/tools/help/adb.html#logcat[^]
[End Modificiation]

Regards,

— Manfred
 
Share this answer
 
v2
Comments
[no name] 13-Nov-12 9:34am    
Thanks, tried, but its don't works for me, and I don't know why...
Manfred Rudolf Bihy 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 Rudolf Bihy 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.

Cheers!
[no name] 13-Nov-12 9:52am    
Console what I see in Eclipse.
lewax00 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900