Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Publish feed will work only with <strong>url</strong> to image.<br></p> <p>See <code>picture</code> property under feed documentation: <a href="https://developers.facebook.com/docs/reference/dialogs/feed/">https://developers.facebook.com/docs/reference/dialogs/feed/</a> </p> <p>If you want to publish image from your memory (like drawable folder) then you need to use: <code>Request.newUploadPhotoRequest()</code></p> <p>Beside this, you can use this simple open source library that supports SDK 3.5 for doing actions like publish photo, feed and so on in a very simple way: <a href="https://github.com/sromku/android-simple-facebook">https://github.com/sromku/android-simple-facebook</a></p> <h3>UPDATE</h3> <p><strong>Option 1</strong><br> You can use <code>Request.newUploadPhotoRequest()</code>, but this method doesn't allow you to add any additional property except the image itself.</p> <pre><code>Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(),R.drawable.ic_launcher); Request.newUploadPhotoRequest(Session.getActiveSession(), bitmap , new Request.Callback() { @Override public void onCompleted(Response response) { // ... handle the response... } }); </code></pre> <p><strong>Option 2</strong><br> If you want to add additional properties to the image like description, then do almost the same but with raw graph api call. The facebook implementation of <code>Request.newUploadPhotoRequest()</code> does exactly the same but without setting additional properties.</p> <pre><code>Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(),R.drawable.ic_launcher); Bundle params = new Bundle(); params.putParcelable("picture", bitmap); params.putString("message", "This is the description of the image"); params.putString("place", "1235456498726"); // place id of the image Request request = new Request(session, "me/photos", bundle, HttpMethod.POST, new Request.Callback() { @Override public void onCompleted(Response response) { // ... handle the response... } }); RequestAsyncTask task = new RequestAsyncTask(request); task.execute(); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload