寻找Android的Facebook的SDK范例

编程入门 行业动态 更新时间:2024-10-26 04:24:13
本文介绍了寻找Android的Facebook的SDK范例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

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

I'm just trying to find a site with some examples on how to use the OFFICIAL facebook android SDK github/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和发布内容之一的壁(stackoverflow/questions/2953146/android-java-post-simple-text-to-facebook-wall).这将有助于你得到一个感觉是什么样子发布的文字之一的墙上。我要指出,虽然你需要首先创建一个Fackbook应用程序,并申请从Fackbook API密钥(www.shoutmeloud/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 (stackoverflow/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 (www.shoutmeloud/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\":\""+"www.google"+"\"," +"\"media\":[{\"type\":\"image\",\"src\":\""+"www.google/logos/mucha10-hp.jpg"+"\",\"href\":\""+"www.google"+"\"}]" +"}"); facebookClient.dialog(this, "stream.publish", parameters, this);

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

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

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

For more help on structuring the "attachment" string, go here: www.mobisoftinfotech/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.

我希望帮助。

更多推荐

寻找Android的Facebook的SDK范例

本文发布于:2023-07-28 00:15:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1225590.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:范例   Android   Facebook   SDK

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!