Skip to content Skip to sidebar Skip to footer

Android Facebook SDK, Upload Pictures To Wall With Profile In Different Language?

Currently I'm able to post mesages and pictures to my wall using my app, by looking for the album 'Wall Photos' it works fine so far, i let a friend of mine to test my app on his p

Solution 1:

Post your code how you are uploading image to facebook. And this is one sample code which is working fine for me just have a look might be helpful to you. And in my code am not creating any album Wall Photos. My picture gets uploaded in wall itself. Just have a look ...

private void fbImageSubmit() {
    if (facebook != null) {
        if (facebook.isSessionValid()) {
            try {
                byte[] data = null;

                // Bitmap bi = BitmapFactory.decodeFile(Constants.imgShare);
                ByteArrayOutputStream baos = new ByteArrayOutputStream();

                bmScreen.compress(Bitmap.CompressFormat.JPEG, 100, baos);
                data = baos.toByteArray();

                Bundle parameters = new Bundle();
                parameters.putString("message", strmsg);
                parameters.putString("method", "photos.upload");
                parameters.putByteArray("picture", data);

                facebook.request(null, parameters, "POST");
                /*
                 * time = Calendar.getInstance().getTime().getHours() + ":"
                 * + Calendar.getInstance().getTime().getMinutes();
                 */

                currentTime = DateFormat.format("hh:mm", d.getTime());
                currentDate = DateFormat.format("dd/MM/yyyy", d.getTime());

                Cursor cursor = Constants.dbHelper
                        .GetDataFromImageName(Constants.enhancedImage
                                .getImagename());
                if (cursor.getCount() > 0) {
                    Constants.dbHelper.updateData(currentDate.toString(),
                            currentTime.toString(), "Facebook", "Image");
                } else {
                    Constants.dbHelper.insertData("true");
                }
                Toast.makeText(getApplicationContext(),
                        "Image uploaded successfully.", Toast.LENGTH_LONG)
                        .show();

            } catch (Exception e) {
                // TODO: handle exception
                System.out.println(e.getMessage());
            }
        }
    }
}

// bmscreen is my bitmap of image ; Hope might be helpful to you.


Solution 2:

try using

parameters.putString("caption", "ooo xxx");

instead of

parameters.putString("message", "test post on wall");

should do the trick, it works to me :)

ps. thanks to user for sharing his answer, it really helps :D


Solution 3:

a) How can i look for the "Wall Photos" album if the user's profile is in a different language?

Set the locale parameter to en_US while querying the Graph API for albums – then you’ll get "Wall Photos" and not the localized album name.

b) How can i create a "Wall Photos" album in case that it doesn't exists?

Uh, I don’t think creating it yourself would be a good idea, since normally it’s automatically created by Facebook – so that might clash when FB later creates an album for the user’s first actual wall posted photo.


Post a Comment for "Android Facebook SDK, Upload Pictures To Wall With Profile In Different Language?"