Skip to content

Instantly share code, notes, and snippets.

@smaspe
Created August 6, 2013 14:40
Show Gist options
  • Save smaspe/6165095 to your computer and use it in GitHub Desktop.
Save smaspe/6165095 to your computer and use it in GitHub Desktop.
JSONObject response = new JSONObject(EntityUtils.toString(
new DefaultHttpClient().execute(
new HttpGet(params[0])).getEntity(), "UTF-8"));
if (response.optBoolean("success", false)) {
return response.getJSONObject("response").getJSONArray("photos");
} else {
Log.w(TAG, "Request failed. Details: " + response.toString(2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment