gpt4 book ai didi

Android facebook SDK,使用不同语言的配置文件将图片上传到墙上?

转载 作者:行者123 更新时间:2023-11-29 16:14:22 25 4
gpt4 key购买 nike

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

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

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

感谢任何帮助,谢谢。

最佳答案

将您的代码发布到如何将图片上传到 Facebook。这是一个对我来说工作正常的示例代码,看看可能对你有帮助。在我的代码中,我没有创建任何相册 Wall Photos。我的照片被上传到墙上。看看...

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

关于Android facebook SDK,使用不同语言的配置文件将图片上传到墙上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10629613/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com