Volley -> JSONRequestWithParameters


RequestQueue requestQueue = Volley.newRequestQueue(this);

String url =”–“;

Map<String,String> params = new HashMap<String, String>();

JsonObjectRequest jsonRequest = new JsonObjectRequest(
new JSONObject(params),
new Response.Listener<JSONObject>(){
public void onResponse(JSONObject response) {

System.out.println(” getJSONRequestWithParameters -> Response : “+response);
new Response.ErrorListener(){
public void onErrorResponse(VolleyError error) {
System.out.println(” getJSONRequestWithParameters -> Error : “+error);
// this is optional if you don’t use this
public String getBodyContentType() {
return “application/json; charset=utf-8”;

jsonRequest.setRetryPolicy(new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

// Add the request to the RequestQueue.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s