android getting all user's friend profile pictures quickly

后端 未结 1 1764
面向向阳花
面向向阳花 2021-01-14 22:51

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 ob

相关标签:
1条回答
  • 2021-01-14 23:34

    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.

    0 讨论(0)
提交回复
热议问题