So here is the JSON
{
"response": {
"data": {
"images": {
"image": [
{...
I want to access the image array. I was wondering if the following code was the best way to do it:
JSONObject jsonObjectResponse = new JSONObject(jsonString);
JSONObject jsonResponse = jsonObjectResponse.getJSONObject("response");
JSONObject jsonObjectData = new JSONObject(jsonResponse.toString());
JSONObject jsonData = jsonObjectData.getJSONObject("data");
JSONObject jsonObjectImages = new JSONObject(jsonData.toString());
JSONObject jsonImages = jsonObjectImages.getJSONObject("images");
JSONObject jsonObjectImage = new JSONObject(jsonImages.toString());
JSONArray jsonImageArray = jsonObjectImage.getJSONArray("image");
I feel like this requires a lot of time for a simple task. Does anyone have a more "engineered" solution? Thanks a lot!