Я пытаюсь получить данные из API flickr, используя volley lib.
это мой json:
{
"photos": {
"page": 1,
"pages": 48,
"perpage": 100,
"total": "4793",
"photo": [
{
*"id": "48955365182",
"owner": "49191827@N00",
*"secret": "fd5e5fd91c",
*"server": "65535",
* "farm": 66,
"title": "permitted burn. thermal, ca. 2019.",
"ispublic": 1,
"isfriend": 0,
"isfamily": 0
}, ...
}
}
Я пытаюсь получить поля с помощью "*":
private void parseJson() {
String URL = "https://www.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=x&user_id=49191827%40N00&extras=&format=json&nojsoncallback=1";
JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, URL, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
JSONArray jsonArray ;
try {
jsonArray = response.getJSONArray("photo");
for(int i=0; i<jsonArray.length(); i++){
JSONObject jsonObject = (JSONObject) jsonArray.get(i);
Log.d("GGG",jsonObject.getString("secret"));
Log.d("GGG",jsonObject.getString("id"));
}
} catch (JSONException e) {
e.printStackTrace();
Log.d("VVV",e.getMessage());
}
}
}, new Response.ErrorListener() {
}
}
);
}