I want parse full data including Episodes, Genre Array but I am using volley lib and getting Main Objects from "anime" array!
How did I get Episodes array's data too? Any simple method?
Also I am adding those data in a single model data so please give me the understanding code.
This is my json data getting from online:
{
  "anime": [
    {
      "title": "Master",
      "img": "img.png",
      "synopsis": "Plot Summary:plot",
      "genres": [
        "adventure",
        "drama",
        "historical",
        "mystery",
        "seinen",
        "slice-of-life"
      ],
      "released": 1998,
      "status": "Completed",
      "otherName": "Master",
      "totalEpisodes": 39,
      "episodes": [
        {
          "id": "episode-1"
        },
        {
          "id": "episode-2"
        },
        {
          "id": "episode-3"
        },
        {
          "id": "episode-4"
        },
        {
          "id": "episode-5"
        },
        {
          "id": "episode-39"
        }
      ]
    },
    {
      "title": "Hyper Police",
      "img": "police.png",
      "synopsis": "Plot Summary: plot",
      "genres": [
        "action",
        "comedy",
        "police",
        "romance",
        "sci-fi"
      ],
      "released": 1997,
      "status": "Completed",
      "otherName": " ploci",
      "totalEpisodes": 25,
      "episodes": [
        {
          "id": "episode-1"
        },
        {
          "id": "episode-2"
        },
        {
          "id": "episode-3"
        },
        {
          "id": "episode-25"
        }
      ]
    }
  ]
}
This code I am calling from MainActivity but doesn’t work.
String url = "API URL";
    final JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null,
        new Response.Listener<JSONObject>() {
        @Override
        public void onResponse(JSONObject response)
        {
            try
            {
            JSONArray jsonArray = response.getJSONArray("anime");
            for (int i = 0; i < jsonArray.length(); i++)
            {
                JSONObject hit = jsonArray.getJSONObject(i);
                JSONArray data = hit.getJSONArray("episodes");
                // Extract JSONObject inside JSONObject
                JSONObject IDOb = data.getJSONObject(i);
                String ids = IDOb.getString("id");
                String title = hit.getString("title");
                String img = hit.getString("img");
                String synopsis = hit.getString("synopsis");
                        String genre = hit.getString("genres");
                        String release = hit.getString("released");
                        String status = hit.getString("status");
                        String otherName = hit.getString("otherName");
                        String totalEpisodes = hit.getString("totalEpisodes");
                mExampleList.add(new ExampleItem(title, img, synopsis, genre, release, status, otherName, totalEpisodes
                                 , ids));
                loadingPop.dismiss();
                Toast.makeText(getActivity(), "Data Refreshed", Toast.LENGTH_SHORT).show();
            }
            mExampleAdapter = new ExampleAdapter(getActivity(), mExampleList);
            mRecyclerView.setAdapter(mExampleAdapter);
            Toast.makeText(getActivity(), "Added Data", Toast.LENGTH_SHORT).show();
            //loadingPop.dismiss();
            }
            catch (JSONException e)
            {
            e.printStackTrace();
            Toast.makeText(getActivity(), "Catch" + e, Toast.LENGTH_LONG).show();
            loadingPop.dismiss();
            }}
        }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error)
        {
            }});
 
     
    