I have a server deployed on:
http://10.222.208.252:9000/file/testpost
The API is only to see if Wear can reach out to it. I have tested the API on Postman, works fine there.
Code on Wear is:
public static void uploadVolley(Context context){ RequestQueue queue = Volley.newRequestQueue(context.getApplicationContext()); String url = "http://10.222.208.252:9000/file/testpost"; StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { // Display the first 500 characters of the response string. Log.d("DC_Util", "response: "+response.toString()); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Log.d("DC_Util", "error response: "+error.getMessage()); } }); queue.add(stringRequest); }
I keep getting error response null.
Am I missing something?
I used to same code snippet to do GET on http://www.google.com. It works fine.