I am trying to do the following task:
I am planning to use JsonObjectRequest (Volley Library) in my code and extract the credentials but I am not able to understand where would the Username and Password be required in the request. This is a code snippet. If anyone can tell where I need to authenticate the Username and Password in this code snippet to fetch the JSON Object, it would be very helpful.
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
VolleyLog.wtf(response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.wtf(error.getMessage(), "utf-8");
}
});
queue.add(jsonObjectRequest)

