Skip to content Skip to sidebar Skip to footer

Android Getting All User's Friend Profile Pictures Quickly

I'm looking for a quick way of getting all my friends's profile pictures. I'm using the Facebook SDK for Android. right now I'm getting my friend's list JSON object and running wit

Solution 1:

If each picture is 4K and you have 1000 friends, that's approximately 4MB of data. It'll take time to download it. There's no way around it if you need all of their pictures.

That said, you should think about whether you really need all of their pictures or not. The vast majority of apps will use the profile pictures of friends to display to the user. Reasonably speaking, the interface is not going to display 1000 friends all at once. A good solution in this case might be to lazy load the images, i.e. store the URL of the image when you parse the JSON for each friend, but don't download the actual images until you need them. If say your interface shows 10 friends at once, then that's only 40K of images which is a whole lot more reasonable.

You can search StackOverflow for android lazy load list images but here's one particular thread that may come useful: Lazy load of images in ListView.

Post a Comment for "Android Getting All User's Friend Profile Pictures Quickly"