如何下载Facebook的个人资料图片 [英] how to download Facebook profile picture

查看:95
本文介绍了如何下载Facebook的个人资料图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid应用程序,用户可以在登录使用Facebook / Twitter的。

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?

我需要用户的个人资料图片谁登录使用Facebook / Twitter的名单,我必须从我的服务器数据库中得到它。 (我有显示类似下图)

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)

推荐答案

使用的AsyncTask的下载它,并把它保存到你的应用程序的磁盘空间。在你的数据库,只存储图片的文件路径(我将其保存的文件名作为FB用户ID)。

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).

您可以看到如何使用的AsyncTask做在GitHub上我的code网络连接。 https://github.com/nedwidek/Android-Rest-API

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

我需要切换工作区才能到code,与本地存储的工作。

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

这篇关于如何下载Facebook的个人资料图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆