Friends, I have a problem in parsing the json content directly from url given http://samplejson.com/transactions.json, but when i store the same url content as a text file in my res/raw folder it parse the data as well,but when fetching the url content from net it shows an exception (i.e) A JSONArray text must starts with '[' at character 1 of...
what's the wrong here.help me to fix this problem
URL url_net = new URL("http://samplejson.com/transactions.json");
InputStream is = url_net.openStream();
byte [] buffer = new byte[is.available()];
while (is.read(buffer) != -1);
String jsontext = new String(buffer);
JSONArray entries = new JSONArray(jsontext);
x = "JSON parsed.\nThere are [" + entries.length() + "]\n\n";
int i;
for (i=0;i<entries.length();i++) { }