Someone know why not works this json in android? urlJson
Result is FileNotFoundException, but on the navigator works.
edit:
public static String readUrl(String urlString) throws Exception {
BufferedReader reader = null;
try{
URL url = new URL(urlString);
reader = new BufferedReader(new InputStreamReader (url.openStream()));
StringBuffer buffer = new StringBuffer();
int read;
char[]chars = new char[1024];
while ((read = reader.read(chars)) != -1)
buffer.append(chars, 0, read);
return buffer.toString();
} finally {
if (reader != null)
reader.close();
}
Use BufferedReader is not the best method to do this task.
Is a lot better use HttpClient with following sample using the library org.json.*;