2

I'm correctly posting a photo to my default album using the code below. Is there a way to add a comment/caption to that photo? Thanks.

Bitmap sourceBitmap = BitmapFactory.decodeFile(bitmapPath);
                    Request request = Request.newUploadPhotoRequest(session, sourceBitmap, new Callback() {

                        @Override
                        public void onCompleted(Response response) {
                        }
                    });
                    request.executeAsync();
Henrique
  • 4,921
  • 6
  • 36
  • 61
  • are you asking if the facebook SDK supports adding a caption to the bitmap, or how to write text on a bitmap in Android? – Gil Moshayof Nov 08 '13 at 03:03
  • Sorry, I'll edit the question to be more specific, but I actually just want to set a text to be uploaded as a caption of the photo, not actually embed the text inside the bitmap itself. Something like "Check out my photo!" – Henrique Nov 08 '13 at 03:05
  • This might be relevant: http://stackoverflow.com/questions/11504129/share-text-and-image-together-using-facebook-sdk-in-android – Gil Moshayof Nov 08 '13 at 03:09
  • You're using a static helper method in Request class(https://developers.facebook.com/docs/reference/android/current/Request/). You're probably going to need to build the Request yourself in order to send specific data... – Tonithy Nov 08 '13 at 03:10

1 Answers1

5

Do something like:

Request request = Request.newUploadPhotoRequest(session, sourceBitmap, new Callback() {...});
Bundle params = request.getParameters();
params.putString("message", "Your Caption Here");
request.setParameters(params);
request.executeAsync();
Ming Li
  • 15,672
  • 3
  • 37
  • 35
  • Hi @Ming Li I am not able to share image with text using the default Facebok app. I am trying FacebookDialog.OpenGraphActionDialogBuilder but still no luck i have gone through these samples https://developers.facebook.com/docs/android/share-dialog/ but no luck. Please help me .. I want to just do the above task using default facebook app which installed in application – KK_07k11A0585 Jan 10 '14 at 07:31
  • Please submit a separate question and include code samples of what you tried to do. – Ming Li Jan 10 '14 at 18:10