Post a picture on the wall from android

I want to post the image on the wall, just like what I can do from the facebook web page.

I tried these two ways, but not what I want.

Is it possible to create a wall record with an image (file from the phone, not the URL)?

Which looks like I posted from the “Upload Photo” on facebook website.

http://i.stack.imgur.com/o16Hn.png (sorry, I can’t post the image)

Thank!

+3
source share
1 answer

The accepted answer in the 1st stream is correct, with only one change, you see when you upload a picture to facebook, for example, when you add a screen, you send it to a specific album called "Wall Photos".

In this answer, they used me / photos, and this will create an album for the application (if it does not already exist) and place the image there.

I think this should work:

Bundle params = new Bundle();
params.putByteArray("source", imageBytes);
params.putString("message", "A wall picture");
facebook.request("me/feed", params, "POST");

(you can obviously use an asynchronous runner)

, "wall photos" , - :

Bundle params = new Bundle();
params.putByteArray("source", imageBytes);
params.putString("message", "A wall picture");
facebook.request("ALBUM_ID/photos", params, "POST");
+2

All Articles