开发者

How do I retrieve a user's Facebook avatar in my Android App?

I'm trying to retrieve the currently-log开发者_开发技巧ged-in user's avatar image so that I can save it on my server and use it later in my application.

How would I go about getting the image directly?


Try this:

(replace USER_ID with alias or user ID...)

set source as https://graph.facebook.com/USER_ID/picture

for example large icon of a Page ID 149926629437 is: http://graph.facebook.com/149926629437/picture?type=large

<img src="http://graph.facebook.com/149926629437/picture?type=large"/>

more info (specify size etc...): http://developers.facebook.com/docs/reference/api/ part Pictures

(I also userd the aQuery (android query) to cache images...

aq.id( holder.image).image("https://graph.facebook.com/" + USER_ID + "/picture?type=normal");

http://code.google.com/p/android-query/

It seems working fine... )


Can't say much about this, but you might want to try the facebook android sdk here ->https://github.com/facebook/facebook-android-sdk . Good luck :)


If you want a higher quality profile picture try:

https://graph.facebook.com/{ID}?fields=picture.height(2048)

And then retrieve the response.picture.data.url

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜