寻找 android Facebook SDK 示例

编程入门 行业动态 更新时间:2024-10-27 00:29:55
本文介绍了寻找 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 和将内容发布到个人墙 (Android/Java -- 将简单的文本发布到 Facebook 墙上?).这应该可以帮助您了解将文本张贴到墙上的感觉.我应该指出,您需要先创建一个 Fackbook 应用程序并从 Fackbook 申请一个 API 密钥(kunukd/)...如果它询问您打算创建的应用的平台,请选择移动设备.

I asked a similar question a few weeks ago regarding the official Facebook Android SDK and posting content to one's wall (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 (kunukd/)...if it asks about the platform of the app you intent to create, choose mobile.

您也可以修改我发布的 Stack Overflow 链接(上面)中的代码来发布照片.目前,根据 Facebook Android SDK 的官方 git 页面(在已知问题"下):

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(该文件必须已经在 Internet 上),您可以将照片发布到您的墙上,但您不能使用此 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.

替换我在其他 Stack Overflow 帖子(上面的链接)中发布的示例代码的以下几行:

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:12:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1225574.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:示例   android   Facebook   SDK

发布评论

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

>www.elefans.com

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