ta54
ta54

Reputation: 256

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

I'm trying to retrieve the currently-logged-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?

Upvotes: 3

Views: 1766

Answers (3)

seantomburke
seantomburke

Reputation: 11692

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

Upvotes: 0

CoPLaS
CoPLaS

Reputation: 1727

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

Upvotes: 2

KSubedi
KSubedi

Reputation: 463

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

Upvotes: 0

Related Questions