Click here to Skip to main content
Rate this: bad
good
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 3:49am
Edited 13-Nov-12 3:50am
v3

1 solution

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

Solution 1

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[^].
 
    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
  Permalink  
v2
Comments
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.
 
Cheers!
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)

  Print Answers RSS
0 DamithSL 390
1 Maciej Los 217
2 OriginalGriff 213
3 BillWoodruff 135
4 Garth J Lancaster 90
0 OriginalGriff 7,953
1 DamithSL 6,139
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,293
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2014
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