寻找Android的Facebook的SDK范例范例、Android、Facebook、SDK

2023-09-12 06:57:28 作者:该昵称无法显示

我看过所有在互联网上,似乎无法找到我要找的......

I've looked all over the internet and can't seem to find what i'm looking for...

我只是想找到一个网站就如何使用Facebook官方Android SDK中的 http://github.com/facebook/facebook-android-sdk

I'm just trying to find a site with some examples on how to use the OFFICIAL facebook android SDK http://github.com/facebook/facebook-android-sdk

要具体,我想看到​​通知的使用和简单的照片上传一些例子。但我会采取什么来帮助获得感受使用SDK。

To be specific i'd like to see some examples on notification use and simple photo upload. But i'll take anything to help get a feel for using the SDK.

如果有人知道的任何实例,请分享太感谢你了!

If anyone knows of any examples please share thank you so much!

推荐答案

我问有关的官方Facebook Android SDK和发布内容之一的壁(http://stackoverflow.com/questions/2953146/android-java-post-simple-text-to-facebook-wall).这将有助于你得到一个感觉是什么样子发布的文字之一的墙上。我要指出,虽然你需要首先创建一个Fackbook应用程序,并申请从Fackbook.com API密钥(http://www.shoutmeloud.com/how-to-acquire-your-facebook-api-key.html)...if它要求对应用程序,你的意图创建,选择移动平台。

I asked a similar question a few weeks ago regarding the official Facebook Android SDK and posting content to one's wall (http://stackoverflow.com/questions/2953146/android-java-post-simple-text-to-facebook-wall). That should help you get a feel for what it's like to post text to one's wall. I should point out though that you need to first create a Fackbook app and apply for an API key from Fackbook.com (http://www.shoutmeloud.com/how-to-acquire-your-facebook-api-key.html)...if it asks about the platform of the app you intent to create, choose mobile.

您可以修改code在堆栈溢出的链接我张贴(图)上传照片了。在present不过,根据官方的git页面为Facebook的Andr​​oid SDK(在已知问题):

You can modify the code in the Stack Overflow link I posted (above) to post photos too. At present though, according to the official git page for the Facebook Android SDK (under "Known Issues"):

3.Binary API参数(如上传图片)是尚未   支持 - 即将推出...

3.Binary API parameters (such as uploading pictures) is not yet supported -- coming soon...

所以,虽然如果你有图像文件的URL您可以发布照片到墙上(该文件必须已经在互联网上),则不能使用此SDK来发送照片的二进制/字节数据从Android设备(尚未...为10年7月24日)。至少,这是我从上面的语句集合。

So, while you can post a photo to your wall if you have the URL of the image file (the file must already be on the Internet), you can't use this SDK to send binary/byte data of the photo from the Android device (yet... as of 07/24/10). At least, that's what I gather from the statement above.

替换的样本code我张贴在其他堆栈溢出后以下行(以上链接):

Replace the following lines of the sample code I posted in the other Stack Overflow post (link above):

Bundle parameters = new Bundle();
parameters.putString("message", "this is a test");// the message to post to the wall
facebookClient.dialog(this, "stream.publish", parameters, this);// "stream.publish" is an API call

Bundle parameters = new Bundle();
parameters.putString("message", "Test Photo");
parameters.putString("attachment", "{\"name\":\"My Test Image\","
+"\"href\":\""+"http://www.google.com"+"\","
+"\"media\":[{\"type\":\"image\",\"src\":\""+"https://m.xsw88.com/allimgs/daicuo/20230912/5852.png.jpg"+"\",\"href\":\""+"http://www.google.com"+"\"}]"
+"}");
facebookClient.dialog(this, "stream.publish", parameters, this);

和你应该能够将照片发布到墙壁(以及文本和链接)。

and you should be able to post photos to your wall (as well as text and links).

有关构建附件字符串的更多帮助,请访问:http://www.mobisoftinfotech.com/blog/android/845/.

For more help on structuring the "attachment" string, go here: http://www.mobisoftinfotech.com/blog/android/845/.

除此之外,考虑使用第三方的包或等待官方的SDK进行更新,如果你需要从设备上传照片到相册直接。

Other than that, consider using a third-party package or wait for the official SDK to be updated if you need to post photos to an album directly from the device.

我希望帮助。

 
精彩推荐