how to download Facebook profile picture

2019-03-02 07:54发布

In my android application, user can logging in using facebook/twitter.

https://graph.facebook.com/username/picture 

https://api.twitter.com/1/users/profile_image?screen_name=screenname&size=normal

using above url i know, i can get picture but is there any way i can download and store it in my database?

i need list of user's profile picture who logged in using facebook/twitter and i have to get it from my server database. (i have to display like below image)

enter image description here

1条回答
相关推荐>>
2楼-- · 2019-03-02 08:08

Use an AsyncTask to download it and save it to your app's disk space. In your database, just store the file path of the picture (I would save it with the filename being the FB user id).

You can see how to use an AsyncTask to do a web connection in my code at github. https://github.com/nedwidek/Android-Rest-API

I'd need to switch workspaces to get to code that works with the local storage.

查看更多
登录 后发表回答