Thanks Hadron. its a food based app. It will show available restaurants in the vicinity. I have 2 calls. My first call will get all the restaurants available. My second call will get the food menus of selected restaurant.
Please let me know how to handle the time out.
I am using volly coding for webservices.
public void registerUser(final String requestType, String username,
String email, String phone, String password,
final ACBConnectionManager callback) {
// TODO Auto-generated method stub
String[] parameterHeader = new String[4];
parameterHeader[0] = "name";
parameterHeader[1] = "email";
parameterHeader[2] = "phone";
parameterHeader[3] = "password";
String[] parameterValue = new String[4];
parameterValue[0] = username;
parameterValue[1] = email;
parameterValue[2] = phone;
parameterValue[3] = password;
String registrationurl = RequestTypes.BASE_URL_REGISTRATION
+ Utility.joinURLParametersArrayWithHeaders(parameterHeader,
parameterValue);
Log.i("registrationurl", registrationurl);
JsonObjectRequest jsonObjReqforRegister = new JsonObjectRequest(
Method.GET, registrationurl, null,
new Response.Listener<JSONObject>() {
@override
public void onResponse(JSONObject response) {
Log.d(TAG, response.toString());
try {
String statusString = response.getString("status");
if (statusString.equals("success")) {
String message = response.getString("message");
callback.onSuccess(message, null, requestType);
} else {
String message = response.getString("message");
callback.onFailure(message, null, requestType);
}
} catch (JSONException e) {
callback.onFailure(Constants.SERVER_ERROR, null,
requestType);
}
}
}, new Response.ErrorListener() {
@override
public void onErrorResponse(VolleyError error) {
VolleyLog.d(TAG, "Error: " + error.getMessage());
callback.onFailure(Constants.SERVER_ERROR, null,
requestType);
}
});
// Adding request to request queue
AppController.getInstance().addToRequestQueue(jsonObjReqforRegister);
}
---------------------------------------
Please let me know how to increase timeout for my call
Thanks,
Hasnu