I would suggest using the below methoddmethod if you are trying to read the json data only.
URL requestUrl=new URL(url); URLConnection con = requestUrl.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); StringBuilder sb=new StringBuilder(); int cp; try { while((cp=rd.read())!=-1){ sb.append((char)cp); } catch(Exception e){ } String json=sb.toString();