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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:02:42+00:00 2026-06-09T14:02:42+00:00

How can I post an image with text on facebook? I know how to

  • 0

How can I post an image with text on facebook? I know how to post text, links, but I want to post an image as well.

Here is what I have tried:

 byte[] data = null;
 Bitmap bi = BitmapFactory.decodeFile("R.drawable.plate1");
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
 data = baos.toByteArray();
 parameters.putByteArray("picture", data);

 int plate = getResources().getIdentifier("com.b2creativedesigns.eyetest:drawable/plate1", null, null);
 parameters.putString("picture", String.valueOf(plate)); 

Neither of them works. When I try to post, nothing happens. Nothing is posted. With the code below, it works.

Posting the image from a website is easy, but it will not work, when the website gets shutdown or the links modified.

  parameters.putString("picture", "https://lh3.ggpht.com/f79UCpnLisZxO2P2C43f55YLvFpNco_cTcC-t9Ck-Qmqe5jwKbfnUvCh5N6-Te-mOw=w124");

3rd example:

  byte[] data = null;
  Bitmap bi = BitmapFactory.decodeFile("R.drawable.plate1");
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
  data = baos.toByteArray();
  parameters.putString("method", "photos.upload");
  parameters.putByteArray("picture", data);
  • 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-06-09T14:02:44+00:00Added an answer on June 9, 2026 at 2:02 pm

    EDIT: Sorry, I shouldn’t have gave advice on how to use the REST API since it’s deprecated. This is how you upload a photo to your own wall using the Graph API.

    Bundle params = new Bundle();
    params.putByteArray("photo", data);
    params.putString("caption", "Test photo upload");
        mAsyncRunner.request("me/photos", params, "POST",
        new PhotoUploadListener(), null);
    

    Please try this and see if it works. This was taken straight out of our HackBook example in our documentation. For the compression of the image, you can use our Utility.scaleImage method inside our SDK which will do all the compression and scaling to match Facebook’s standards.

    ==================================================================================

    ORIGINAL MESSAGE:

    photos.upload is using the REST API and is deprecated so I would recommend using the Graph API to upload photos but here’s the quick and dirty solution using the REST API.

    Once you have the byte array in a variable like data, do the following:

    Bundle params = new Bundle();
    params.putString("method", "photos.upload");
    params.putByteArray("picture", data);
    mFacebook.request(params);
    

    Let me know if that helps.

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

Sidebar

Related Questions

I want to post some text with image on Facebook wall. I have this
HI Guys, Here I am having problem that How can I post an image
From where I can start For interaction with Facebook like post Image on wall,
I can post on group / page and user wall, but i don't want
I have two entity classes, Student and Committee. I can not post images, but
i want to post on Facebook Wall but i just dont want to post
(i can't post images so i posted links instead) i'm working on a 2D
Only editor can post into database but the price could'nt Post into database.. So,
Users on my site can post news items. But right now, it's all honor
We have a website wherein a user can post information from our website to

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.