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(""+id+"/picture" );

But I don't get the desired result.


You should change your code following:

URL image_value = new URL(""+id+"/picture" );

Possible GET parameters for the URL can be found here:

Use https:// instead of http:// i faced the same problem.

URL image_value = new URL(""+id+"/picture" );
profPict = BitmapFactory.decodeStream(image_value.openConnection().getInputStream());

If you are trying to display profile pic in your app, use ProfilePictureView from Facebook SDK.

Refer This

Just call setProfileId(String profileId) on it.

It will take care of displaying the image.

String id = user.getId();
try {
  URL url = new URL(""+ id+ "/picture?type=large");
  String image_path = uri.toString();
  System.out.println("image::> " + image_path);
catch (MalformedURLException e) {

Use ProfilePictureView from facebook sdk.

You can do something like this inside a thread:

String url = ""+id+"/picture";
HttpConnection conn = new HttpConnection(url);

Drawable d = Drawable.createFromStream(new BufferedInputStream(conn.getInputStream()), "image");


I hope it help you.

try this..

 try {
        imageURL = new URL("" +
                                                id+ "/picture?type=large");
        Log.e("URL", imageURL.toString());
        } catch (MalformedURLException e1) {
                // TODO Auto-generated catch block
             try {
                    bitmap = BitmapFactory.decodeStream(imageURL
                } catch (IOException e) {
                        // TODO Auto-generated catch block


Once your facebook account is logged into the application, simply do:

String url = Profile.getCurrentProfile().getProfilePictureUri(x, y).toString();

x and y are width and height.

See the doc :

Need Your Help

How to access /storage/emulated/0/

android android-sdcard android-file

I have written a code to record audio and save it to below file location.

Check modifierFlags of NSEvent if a certain modifier was pressed but no other

objective-c cocoa event-listener nsevent modifier-key

I just experimented with the addLocalMonitorForEventsMatchingMask:handler: method in NSEvent and came across the following question: How do I find out if only certain modifiers were pressed?