I have an app that communicates with a Ricoh Theta camera. The camera creates its WiFi network and OSC (Open Spherical Camera) web server (IP 192.168.1.1, port 80), on which I connect my device. Everything works fine if only the WiFi is ON. But when I also put the mobile data ON, then I get a timeout error.
No sure if it can be useful, but here is some code:
protected void executePost(String request, final String body, final RequestListener listener) {
StringRequest stringRequest = new StringRequest(Request.Method.POST, "http://" + mIpAddress + ":" + mPort + request,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if(listener != null) {
handleResponse(response, listener);
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if(listener != null) {
listener.onError(error);
}
}
}
)
{
@Override
public byte[] getBody() throws AuthFailureError {
return body == null ? null : body.getBytes();
}
};
int socketTimeout = 30000;
RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
stringRequest.setRetryPolicy(policy);
stringRequest.setTag(REQUEST_TAG);
mRequestQueue.add(stringRequest);
}
Is there a way to tell Volley to use the WiFi only? Or first?