Android facebook SDK,用不同语言的个人资料将图片上传到墙上? [英] Android facebook SDK, upload pictures to wall with profile in different language?

查看:12
本文介绍了Android facebook SDK,用不同语言的个人资料将图片上传到墙上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我可以使用我的应用程序将消息和图片发布到我的墙上,通过寻找专辑Wall Photos"到目前为止它工作正常,我让我的一个朋友在他的手机上测试我的应用程序看看如果它适用于任何用户,当他尝试上传图片时它不起作用,现在我认为这可能与他的个人资料是西班牙语的事实有关,所以寻找专辑Wall photos"不可能,我看了他的相册,令我惊讶的是,他没有任何与他的语言相当的墙照片"相册,所以..长话短说:

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 phone to see if it works fine with any user, when he tried to upload a picture it didn't work, now i think it might be have something to do with the fact that his profile is in spanish, so looking for the album "Wall photos" could not be possible, i took a look at his photo albums and for my surprise he didn't have any "Wall photos" album equivalent in his language, So.. long story short:

a) 如果用户的个人资料使用不同的语言,我如何查找Wall Photos"相册?

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

b) 如果Wall Photos"相册不存在,我该如何创建它?

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

感谢您的帮助.

推荐答案

发布您如何将图像上传到 Facebook 的代码.这是一个对我来说运行良好的示例代码,看看可能对你有帮助.在我的代码中没有创建任何相册墙照片.我的照片被上传到墙上.看看吧……

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 是我的图像位图;希望对你有帮助.

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

这篇关于Android facebook SDK,用不同语言的个人资料将图片上传到墙上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆