目前,我可以使用我的应用程序将消息和图片发布到墙上,通过查找专辑“ Wall Photos”,到目前为止该专辑仍然可以正常使用,我让我的一个朋友在他的手机上测试了我的应用程序,看看它是否可以正常工作对任何用户都很好,当他尝试上传照片时不起作用,现在我认为这可能与他的个人资料是西班牙文有关,因此寻找专辑“ Wall photos”不可能可能的话,我看了看他的相册,令我惊讶的是,他没有任何与他的语言相对应的“ 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是我的图像位图;
希望对您有所帮助。