• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Post values using Volley

Hi,

I tried to post parameters to server. And I used JSONObjectRequest and

StringRequest also using Volley. But parameter won't send to server.

Please help for solve this issue.:o


Kindly check given below code details.

HashMap<String, String> params = new HashMap<String, String>();
params.put("username", "demo@tracme.co.in");
params.put("password", "demo");

try {

JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.POST,
aURL,new JSONObject(params),
new Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {
Log.d("#######", response.toString());

resultTxt.setText(response.toString());

aDialog.hide();
}
}, new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.d("********",
"Error: " + error.getMessage());

resultTxt.setText(error.toString());

aDialog.hide();
}
}) {

};
// Adding request to request queue
aQueue.add(jsonObjReq);


Thanks&Regards,
Ramesh babu.K
 
Welcome to AndroidForums.com RameshbabuK.:)

I moved your thread to our application development forum where you are more likely to get a useful answer.

Good luck with your app.:thumb:
 
Back
Top Bottom