To the best of my (current) understanding, Android does not have a console for sending messages so that System.out.println messages are lost. Instead, use Log.x (output in LogCat).
However, in the popular Pro Android 2 book, Listing 8-1 does just that:
in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
String page = sb.toString();
System.out.println(page);
Does System.out.println really work on Android or is it just a typo?
If the first (i.e. not a typo), what does it really do and where should I expect a conclusion?
source
share