Skip to content

Instantly share code, notes, and snippets.

@iraSenthil
Created June 13, 2013 15:44
Show Gist options
  • Select an option

  • Save iraSenthil/5774768 to your computer and use it in GitHub Desktop.

Select an option

Save iraSenthil/5774768 to your computer and use it in GitHub Desktop.
private void getTotalDistance(String accessToken) {
try {
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet("http://api.runkeeper.com/records");
get.addHeader("Authorization", "Bearer " + accessToken);
get.addHeader("Accept", "*/*");
HttpResponse response = client.execute(get);
String jsonString = EntityUtils.toString(response.getEntity());
JSONArray jsonArray = new JSONArray(jsonString);
findTotalWalkingDistance(jsonArray);
} catch (Exception e) {
displayToast("Exception occured:(");
e.printStackTrace();
resetUi();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment