【问题标题】:Facebook Check-in with camera picture bytearray使用相机图片字节数组进行 Facebook 签到
【发布时间】:2011-08-31 17:25:51
【问题描述】:

是否可以通过设备上的图片进行签到?

我尝试使用“图片”包,但它仅在我指向 URL 时才有效,如果我使用字节数组则无效。如果我使用字节数组,图片就不会显示在墙上。

工作: bundle.putString("图片", "http://www.somewhere.com/picture.jpg");

不工作: bundle.putByteArray("图片", imageByteArray[]);

Bundle bundle = new Bundle();
bundle.putByteArray("picture", imageByteArray[]);  // load from device
bundle.putString("message", "The offee is just meh.");
bundle.putString("place", "my place id");
bundle.putString("coordinates", "my coordinates");
bundle.putString("access_token", mFacebook.getAccessToken());

mAsyncRunner.request("me/checkins", bundle, "POST", new CheckinListener(), null);

【问题讨论】:

    标签: android facebook facebook-graph-api image checkin


    【解决方案1】:

    我不确定,因为我从未真正尝试过使用 Check-In,但你不能使用本地 URL 吗?例如,将您的字节数组保存在 SDCARD 上的 JPG 文件中,然后提供file:// URL。

    【讨论】:

    • 嗨瓦伦丁,感谢您的评论。我尝试了您的建议,但服务器返回“(#100) 图片 URL 格式不正确。”这是我的代码: String filepath = "file://" + Environment.getExternalStorageDirectory() + "/myFolder/myPicture.png";还有其他想法吗?谢谢。
    • 可能最终的网址是错误的,我不知道。尝试查看 "file://" + Environment.getExternalStorageDirectory() + "/myFolder/myPicture.png" 的作用,以及它是否是有效的 URL
    猜你喜欢
    • 2015-09-27
    • 1970-01-01
    • 2014-06-27
    • 1970-01-01
    • 1970-01-01
    • 2011-09-12
    • 1970-01-01
    • 2014-12-11
    • 1970-01-01
    相关资源
    最近更新 更多