Reputation: 3538
Hey folks so here i am starting out with a few baby steps in Android Programming . i went through the relevant videos and feel confident to jump into the pool . My motivation is to make a simple app that gives the waiting time for my school buses at the university . The examples that i saw made using of JSON parsing to parse data from the internet specifically twitter . So how do i check if the website that i want to pull in information gives me such APIS or not . For example for a site like http://www.sbstransit.com.sg/ i see no APIs for parsing . So how do i go about in this case . This is just an example website .
Upvotes: 1
Views: 281
Reputation: 704
Try out like ...
String response = 'json string';
try {
JSONArray responseObj= new JSONArray(response);
String week_percentage_work = responseObj.getString("key");
}
} catch (JSONException e) {
e.printStackTrace();
}
More information please visit : android-json-parsing-tutorial
Upvotes: 1