Skip to content

Instantly share code, notes, and snippets.

@meeDamian
Created September 23, 2013 10:14
Show Gist options
  • Save meeDamian/6668665 to your computer and use it in GitHub Desktop.
Save meeDamian/6668665 to your computer and use it in GitHub Desktop.
Simple download JSON example using Volley
Volley.newRequestQueue(this).add(
new JsonObjectRequest(Request.Method.GET, "http://your-url.com/file.json", null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {} // what happens on success?
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {} // what happens on fail?
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment