Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get facebook profile picture of user in facebook SDK 3.0 Android

i am using facebook SDK 3.0 i have to get profile picture of user login. Here is the code I use:

URL image_value = new URL("http://graph.facebook.com/"+id+"/picture" );
profPict=BitmapFactory.decodeStream(image_value.openConnection().getInputStream());

But I don't get the desired result.

like image 382
Arun Avatar asked May 04 '13 09:05

Arun


People also ask

How did you integrate the Facebook SDK in Android app?

To use the Facebook SDK in an Android Studio project, add the SDK as a build dependency and import the SDK. Go to Android Studio | New Project | Minimum SDK. Select API 15: Android 4.0. 3 (IceCreamSandwich) or higher and create your new project.


1 Answers

You should change your code following:

URL image_value = new URL("http://graph.facebook.com/"+id+"/picture" );

Possible GET parameters for the URL can be found here: https://developers.facebook.com/docs/graph-api/reference/user/picture/

like image 181
Hai nguyen Avatar answered Sep 23 '22 04:09

Hai nguyen