I searched a lot from internet to set request timeout of volley. I end up with getting solution of Retry Policy but when researched it does not set timeout it sets the retry time of request but I don't want to retry my request. I want to increase volley request timeout so that a slower network can access data, volley timeout set to 5 sec that means if network does not connect till 5 sec it will throw timeout exception. how can I manage to change time to getting response from server.
my code is
ProjectHistory.requestQueue = Volley.newRequestQueue(mContext);
int socketTimeout = 30000;//30 seconds - change to what you want
RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
stringRequest.setRetryPolicy(policy);
ProjectHistory.requestQueue.add(stringRequest);
I have two question --
(1) Will it retry the request after 30 sec?
(2) how to set request timeout 30 sec so that slower network can load data?