Android : how can i convert the JSON data fetched from web service and display in my app?

on Tuesday, September 16, 2014


i have called the web service but the data received is in json format any help would be appreciated



URL url = new URL(urls[0]);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);

OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write( data );
wr.flush();

reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
StringBuilder sb = new StringBuilder();
String line = null;

while((line = reader.readLine()) != null)
{
sb.append(line + " ");
}
Content = sb.toString();

0 comments:

Post a Comment