How to read below JSON data from API using retrofit? from struts and hibernate service,i am getting and sending data using Bean class from api [duplicate]

You have json array so you need to read like below

  try {

        JSONArray jsonArray=new JSONArray("your data");


            for(int i=0;i<jsonArray.length();i++){
                JSONObject jsonObject=jsonArray.getJSONObject(i);

                JSONObject messageObj=jsonObject.getJSONObject("message");
                String user_id=messageObj.getString("user_id");
                String user_type=messageObj.getString("user_type");
                ----and so on.

      } catch (Exception e) {

Browse More Popular Posts

Leave a Comment