Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:45:32+00:00 2026-05-27T06:45:32+00:00

When I do a request for a profile picture, mine in this case I

  • 0

When I do a request for a profile picture, mine in this case I receive some kind of encoded string in my HttpResponseHandler. The code below is the request for my profile picture.

private static AsyncHttpClient client = new AsyncHttpClient();

client.get("http://graph.facebook.com/1206433/picture",  fbPictureHandler);

The code below is my handler to retrieve a response. I get the response as a string, but I am not sure what to do with this response object. I have tried converting to a byte array and writing to “file.jpg” this hasnt worked. My main question is what do I do with this response object?

private static AsyncHttpResponseHandler fbPictureHandler = new AsyncHttpResponseHandler ()        
{
@Override
public void onStart() {
Log.d(TAG,"started picture handler");
}
@Override
public void onSuccess(String response) {
        //Not sure what to do here, have been unable to do anything with this Byte   //array
    byte[] imageBackground = response.getBytes();

    }
    @Override
    public void onFailure(Throwable error) {
        Log.d(TAG, "unable to retrieve picture");
        error.printStackTrace();
    }
    @Override
    public void onFinish() {
        Log.d(TAG,"Finished picture handler");
    }
};

This is the PrintString of the response object

11-29 19:42:12.640: D/Yatter Facebook(3551): ÿØÿà��JFIF������������ÿþ��;CREATOR: gd-jpeg     v1.0 (using IJG JPEG v62), quality = 95

ANy help is greatly appreciated and hopefully this can help others.

Thank you,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:45:33+00:00Added an answer on May 27, 2026 at 6:45 am

    Use the following request instead of the one that you are issuing

    http://graph.facebook.com/1206433?fields=picture

    This will return a JSON string to you in the following format which contains the original path to the profile image.

    {
       "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/260615_1206433_140418666_q.jpg"
    }
    

    Parse this string to get the path of “picture” and use it in your code to get the picture.


    Here is a sample request example

    NOTE : http://profile.ak.fbcdn.net/hprofile-ak-snc4/260615_1206433_140418666_q.jpg is obtained by parsing the JSON string in the first step.

    WebRequest request = WebRequest.Create("http://profile.ak.fbcdn.net/hprofile-ak-snc4/260615_1206433_140418666_q.jpg");
    WebResponse response = request.GetResponse();
    Stream stream = response.GetResponseStream();
    pictureBox1.Image = Image.FromStream(stream);
    

    This will load the image to a picture box in a windows form application.

    If you need anymore help let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an app that will request the profile picture URL of some
According to Facebook graph API we can request a user profile picture with this
Below is the code for titanium: var request = Titanium.Network.createHTTPClient(); request.open(POST, bh.serverAddress + MyCareer.svc/PostMessage/+
This request is based in MS Access VBA. I would like to know what
I request a website header, however, there is not Last-Modified info in this http
I use authlogic for authentication and paperclip for handling user's profile picture attachments. I
I want to extract the values - Screen Name, Name, ID, Profile Picture URL
I want to show the users profile picture in a list view. When I
I'm having trouble passing the url for a users facebook profile picture to a
I have this code: $(document).ready(function() { var url = https://graph.facebook.com/search?q=cinema&type=post; $.ajax({ type: POST, url:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.