title: Android Facebook SDK 3.0 upload local image
body: <p>There isn't seem to be a clear reference about this.
  I'm creating an Android app which user can login to FB.</p>
  
  <p>I followed <a href="https://developers.facebook.com/docs/howtos/androidsdk/3.0/publish-to-feed/" rel="noreferrer">this tutorial on FB site</a>, which gives an example of publishing a picture from a web URL: 
  postParams.putString("picture", "https:// image URL");</p>
  
  <p>However, i want to upload to the logged-in user's timeline a local PNG image from my project, which located on all res-drawable folders.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>void publishStory() 
  {
          Session session = Session.getActiveSession();
  
          if (session != null)
          {       
              Bundle postParams = new Bundle();
  
              postParams.putString("name", "Name here.");
              postParams.putString("caption", "Caption here.");
              postParams.putString("description", "Description here.");
              postParams.putString("link", "https://developers.facebook.com/android");
  
              byte[] data = null;
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              Bitmap bi = BitmapFactory.decodeResource(getResources(),R.drawable.logonew);
              bi.compress(Bitmap.CompressFormat.PNG, 100, baos);
              data = baos.toByteArray();
  
              postParams.putString("method", "photos.upload");
              postParams.putByteArray("picture", data);
  
              Request.Callback callback = new Request.Callback() 
              {
                  public void onCompleted(Response response) 
                  {
                      FacebookRequestError error = response.getError();
  
                      if (error != null) 
                          Toast.makeText(_context , error.getErrorMessage(), Toast.LENGTH_SHORT).show();
  
                      else 
                          Toast.makeText(_context, "Posted successful on your wall", Toast.LENGTH_SHORT).show();
                  }
              };
  
              Request request = new Request(session, "me/feed", postParams, HttpMethod.POST, callback);
              RequestAsyncTask task = new RequestAsyncTask(request);
              task.execute();
          }
      }
  </code></pre>
  
  <p>All the examples i could find are dealing with Facebook class instances and AsyncFacebookRunner which are depressed. </p>
  
  <p>Moreover, the error response i get from the request is:
  <em>HttpStatus: 400, errorCode: 100, errorType: GraphMethodException, errorMessage: Unsupported method, photos.upload</em></p>
  
  <p>So what is the photos.upload replacement? Please advise, a code example will be great, tnx. </p>