Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Regular Contributor
Posts: 75
Registered: ‎07-22-2010
My Device: Not Specified
My Carrier: Trainee

How to upload a photo in Facebook from application?

[ Edited ]

How can I post photo in Facebook. 

I have gone through Strawberry for blackberry. 



  public void publishStream(String message, String pictureUrl, String linkUrl, String linkName, String linkCaption, String linkDescription, String sourceUrl) {
                try {
                        JSONObject object = new JSONObject();
                        object.put("message", message);
                        object.put("picture", pictureUrl);
                        object.put("link", linkUrl);
                        object.put("name", linkName);
                        object.put("caption", linkCaption);
                        object.put("description", linkDescription);
                        object.put("source", sourceUrl);
                        JSONObject responseObject = (JSONObject) graph.write(root + "/feed", object);
                } catch (Exception e) {


If I hardcode it for testing. 

Suppose I gave 


Bitmap j = Bitmap.getBitmapResource("src/img/jk1.jpg");

                                    String s = (String.valueOf(j)).toString();

                                    //byte[] k = s.getBytes();

                                    String h = encodeUTF(s);//Base64.encode(k);


                                    System.out.println("s >>>>>>>>>>>>>>>>>   "+h);

                                        users[0].publishStream("It's me", h , "http://www.facebook.com/album.php?aid=65969s&id=100000512262020", "Saraswati Puja 2011 (@ office)", "A","B",h);


I dont know what i have to put in pictureUrl ,linkNamelinkCaptionlinkDescriptionsourceUrl



Please please help me...

Thanks in advance