Get city information from wikipedia, and show it on an Android APP.
However, every time I try to transform the data to JSON, throws an exception
url = new URL("https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Threadless&rvprop=content&format=json&rvsection=0");
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
String line ="";
InputStreamReader isr = new InputStreamReader(connection.getInputStream());
BufferedReader reader = new BufferedReader(isr);
sb = new StringBuilder();
while ((line = reader.readLine()) != null){
sb.append(line);
}
JSONObject city;
JSONArray jsondata = new JSONArray(sb.toString());
city = jsondata.getJSONObject(0);