public static List<Blog> parse(String data){
  List<Blog> blogList=null;
  Blog blog=null;
  if (data != null && !data.equals(""))   try {
    JSONTokener jsonParser=new JSONTokener(data);
    JSONObject content=(JSONObject)jsonParser.nextValue();
    JSONArray list=content.getJSONArray("data");
    if (list.length() > 0)     blogList=new ArrayList<>();
    for (int i=0; i < list.length(); ++i) {
      JSONObject info=(JSONObject)list.get(i);
      blog=new Blog();
      blog.setAuthor_name(info.getString("author"));
      blog.setPostId(info.getString("blog_id"));
      blog.setUrl(StringUtils.toUrl(info.getString("blog_url")));
      blog.setBlogId(StringUtils.toInt(info.getString("blog_id")));
      blog.setBlogapp(info.getString("blogapp"));
      blog.setComments(StringUtils.toInt(info.getString("comment")));
      blog.setSummary(info.getString("content"));
      blog.setReads(StringUtils.toInt(info.getString("hit")));
      blog.setTitle(info.getString("title"));
      blog.setUpdated(StringUtils.toDate(info.getString("public_time")));
      if (blogList != null) {
        blogList.add(blog);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return blogList;
}

public static List < Blog > parse ( String data ) { List < Blog > blogList = null ; Blog blog = null ; if ( data != null && ! data . equals ( "" ) ) try { JSONTokener jsonParser = new JSONTokener ( data ) ; JSONObject content = ( JSONObject ) jsonParser . nextValue ( ) ; JSONArray list = content . getJSONArray ( "data" ) ; if ( list . length ( ) > 0 ) blogList = new ArrayList < > ( ) ; for ( int i = 0 ; i < list . length ( ) ; ++ i ) { JSONObject info = ( JSONObject ) list . get ( i ) ; blog = new Blog ( ) ; blog . setAuthor_name ( info . getString ( "author" ) ) ; blog . setPostId ( info . getString ( "blog_id" ) ) ; blog . setUrl ( StringUtils . toUrl ( info . getString ( "blog_url" ) ) ) ; blog . setBlogId ( StringUtils . toInt ( info . getString ( "blog_id" ) ) ) ; blog . setBlogapp ( info . getString ( "blogapp" ) ) ; blog . setComments ( StringUtils . toInt ( info . getString ( "comment" ) ) ) ; blog . setSummary ( info . getString ( "content" ) ) ; blog . setReads ( StringUtils . toInt ( info . getString ( "hit" ) ) ) ; blog . setTitle ( info . getString ( "title" ) ) ; blog . setUpdated ( StringUtils . toDate ( info . getString ( "public_time" ) ) ) ; if ( blogList != null ) { blogList . add ( blog ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } return blogList ; }
parse the dato to blog list .
