How to parse complex JSON file in android

后端 未结 2 680
醉酒成梦
醉酒成梦 2020-12-03 16:34

I need to parse this json string

 {
\"results\": {
    \"result\": [
        {
            \"cover\": \"http://ia.media-imdb.com/images/M/MV5BMjMyOTM4MDMxNV5         


        
2条回答
  •  [愿得一人]
    2020-12-03 17:16

    First of all please look at some tutorials like:

    http://www.androidhive.info/2012/01/android-json-parsing-tutorial/

    http://www.vogella.com/articles/AndroidJSON/article.html

    JSONObject response = new JSONObject(respString);
    ArrayList bookCollection = new ArrayList();//
        if(response.has("results")){
            if(response.has("result")){
                JSONArray resultArray = response.getJSONArray("result");
                for(int iCount=0; iCount

    The pojo to populate

    public Book{
    
    public String cover;
    public String title;
    
    }
    

提交回复
热议问题