I have this JSON on the server side:
[{"idreg":"271896",
"code":"USD",
"codein":"BRL",
"name":"D\u00f3lar Comercial",
"high":"3.2652",
"pctChange":"-0.939",
"open":"0",
"bid":"3.2492",
"ask":"3.2497"}]
I want to use the value of "ask" but I do not know exactly how to interpret it.
Here is my code:
JsonObjectRequest obreq = new JsonObjectRequest(Request.Method.GET, url, new
Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
JSONObject obj = response.getJSONObject("ask");
}
JSONcatch (JSONException e) {
e.printStackTrace();
}
}
},null);
That way it does not return the value, what should I do to fix it?