-1

I get a json data successfully from Twitter Rest Api. You can see the json data at following link. https://dev.twitter.com/rest/reference/get/friends/list. I'm trying to do bind this friends list json data to my listview.I will bind username,profile picture etc.Note that there can be thousands of data.Is it a good practice binding all data or should i bind them like loading 10 datas.

MyTwitterApiClients apiclients = new MyTwitterApiClients(session);
        apiclients.getFriendsListService().show(userID, userName, new Callback<Response>(){
            @Override
            public void success(Result<Response> result) {

                BufferedReader reader = null;
                StringBuilder sb = new StringBuilder();

                try {
                    reader = new BufferedReader(new InputStreamReader(result.response.getBody().in()));
                    String line;

                    while ((line = reader.readLine()) != null) {
                        sb.append(line);
                    }

                } catch (IOException e) {
                    e.printStackTrace();
                }

                String jsonResult = sb.toString();

                try {
                    JSONObject objResult=new JSONObject(jsonResult);

                    ///What should i do ?

                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
Trinity
  • 486
  • 8
  • 27

1 Answers1

1

I suggest you to have a look here: here you can find good examples on how to manage those kind of situations.

In a nutshell: if you're having hundreds/thousands of images to load, it's better if you don't load them all together, but only when you really need to show 'em

Community
  • 1
  • 1
Stefano
  • 156
  • 3
  • 14