1

i've searched this whole forum. The best match i could find was this one: Android - Upload photo to Facebook with Facebook Android SDK

Unfortunately this one only show how to upload picture from disk to facebook profile of the currently logon user.

I want to be able to upload photo to profile of friend. Till now I could only manage to do so by provide picture URL instead of uploading byte array from the disk.

Thanks,

piggy181

Community
  • 1
  • 1
piggy181
  • 11
  • 3

1 Answers1

0

Here is the code i use, feel free to use it:

Bundle postdata = new Bundle();
postdata.putString("caption", msg);
postdata.putByteArray("photo", pic);
mAsyncRunner.request(usr+"/photos&access_token="+fb.getAccessToken(), postdata, "POST",new WallRequestListener(), null);

where "usr" is the user ID of your friend, caption is the message that will be posted with the picture, and photo well that's the picture :) which is sent as a byte array.

You can get the user's ID making a request to "me/friends".

I hope that helps.

Slacker616
  • 845
  • 1
  • 11
  • 20