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 7494337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:29:09+00:00 2026-05-29T17:29:09+00:00

Hi I am using a tutorial to post image on facebook but its not

  • 0

Hi I am using a tutorial to post image on facebook but its not posting. Please guide what i am doing wrong. I have facebook.apk installed on mobile. I have done extactly what is described on Facebook developer guiide.

Here is the error….
enter image description here

public class DummyActivity extends Activity {
Facebook facebook = new Facebook("xxxxxxxxxxxx");

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    facebook.authorize(this, new DialogListener() {
        public void onComplete(Bundle values) {
             byte[] data = null;

             Bitmap bi = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
             data = baos.toByteArray();

             Bundle params = new Bundle();
             params.putString(Facebook.TOKEN, facebook.getAccessToken());
             params.putString("method", "photos.upload");
             params.putByteArray("picture", data);

             AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
             mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);
        }

        public void onFacebookError(FacebookError error) {}

        public void onError(DialogError e) {}

        public void onCancel() {}         
    });
}




@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    facebook.authorizeCallback(requestCode, resultCode, data);
}

Here is another class,

  public class SampleUploadListener implements RequestListener {

public void onComplete(String response, Object state) {
    // TODO Auto-generated method stub
      try {
            // process the response here: (executed in background thread)
            Log.d("Facebook-Example", "Response: " + response.toString());
            JSONObject json = Util.parseJson(response);
            final String src = json.getString("src");

            // then post the processed result back to the UI thread
            // if we do not do this, an runtime exception will be generated
            // e.g. "CalledFromWrongThreadException: Only the original
            // thread that created a view hierarchy can touch its views."

        } catch (JSONException e) {
            Log.w("Facebook-Example", "JSON Error in response");
        } catch (FacebookError e) {
            Log.w("Facebook-Example", "Facebook Error: " + e.getMessage());
        }

}

public void onIOException(IOException e, Object state) {
    // TODO Auto-generated method stub

}

public void onFileNotFoundException(FileNotFoundException e, Object state) {
    // TODO Auto-generated method stub

}

public void onMalformedURLException(MalformedURLException e, Object state) {
    // TODO Auto-generated method stub

}

public void onFacebookError(FacebookError e, Object state) {
    // TODO Auto-generated method stub

}
  • 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-29T17:29:11+00:00Added an answer on May 29, 2026 at 5:29 pm

    OK, i managed to log in, and posted is it the right response…

    02-13 14:48:55.949: D/Facebook-Example(2814): Response: {"pid":"100002384000781_493454","aid":"100002384000781_53368","owner":100002384000781,"src":"http:\/\/photos-h.ak.fbcdn.net\/hphotos-ak-ash4\/400189_233648050057993_100002384000781_493454_803419378_s.jpg","src_big":"http:\/\/a8.sphotos.ak.fbcdn.net\/hphotos-ak-ash4\/400189_233648050057993_100002384000781_493454_803419378_n.jpg","src_small":"http:\/\/photos-h.ak.fbcdn.net\/hphotos-ak-ash4\/400189_233648050057993_100002384000781_493454_803419378_t.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=233648050057993&set=a.233615786727886.53368.100002384000781&type=1","caption":"","created":1329124670,"object_id":233648050057993}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I built a facebook apps from an tutorial with using adobe flash builder 4.5
I'm currently using SQLite3 with a simple post and image sharing app, similar to
The tutorial I'm following ( http://www.bluerosegames.com/xna101/post/Lesson-9-Improving-the-BouncingBall-Class-Using-Properties.aspx ) private Vector2 _position; public Vector2 Position {
I found this tutorial that explains what I want to do using html but
I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against
I was learning python using the tutorial that comes with the standard python installation.
I built a Jquery dropdown menu using this tutorial . It works across browsers
I just installed Glassfish on my Ubuntu server (No GUI) using THIS tutorial. Everything
I'm trying to get Django running on GAE using this tutorial . When I
I've created my own little c# compiler using the tutorial on MSDN, and it's

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.