How should I fetch images under an array using retrofit How should I fetch images under an array using retrofit json json

How should I fetch images under an array using retrofit


Try this way...

First off create model classes from your response, for that copy your response and add your response here http://pojo.sodhanalibrary.com/ , here it will create all pojo classes from your response.

Now...change you api call method

Call<Product_base_response>

to

Call<JsonObject>

Now just print response in onResponse method like

Log.d("===","onResponse :: "+response.body());

if you got your response here,

   Gson gson = new Gson();Your_Main_Model mainModel = gson.fromJson(jsonObject.toString(), Your_Main_Model.class);

Now, to get images you need to go through main model like

Main_model.data_object_model.product_images_model_list.get(0).getImage();

Hope this works, if you didn't get it or this not work let me know