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

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

问题描述

目前我能够用我的应用程序发布mesages和图片到我的墙,通过查找专辑长城照片它工作正常,到目前为止,我让我的一个朋友来测试我的应用程序对他的电话,看看如果它正常工作与任何用户,当他试图上传图片没有工作,现在我想可能是有一些做的事实,他的个人资料是西班牙语,所以找了专辑长城照可能是不可能的,我看了看他的相册和我吃惊的是他没有任何长城照片相册相当于他的语言, 所以..长话短说:

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) How can i look for the "Wall Photos" album if the user's profile is in a different language?

二)我如何建立的情况下,它不存在长城照片相册?

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

任何帮助是AP preciated,谢谢。

Any help is appreciated, thanks.

推荐答案

发表您的code你如何上传图片至Facebook。这是一个样本code这是工作的罚款,我只是看看也许对你有所帮助。而在我的code我不会创建任何唱片墙的照片。我的照片被上传墙体本身。随便看看...

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天全站免登陆