Android 使用Facebook API 开发

公司需要做FB插件,故研究了一下,下面是总结:

1.在https://developers.facebook.com/android/  下载sdk 3.0

2.可以按照https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/ 开始做 前几部估计是android开发者都会,那么跳到第四步

有个问题是

keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64
获取hash的时候 发现找不到openssl命令 那就去http://www.onlinedown.net/soft/85287.htm下载了一个包 也不行添加到bin中了 于是直接解压放到了 c盘目录



这样执行就得到了hash了

然后创建一个应用按照start的说明填写了一下



然后把他的sdk和simples导入到eclipse中 更改了一下错误的android lib

就可以运行了

simple的appid在 string.xml中配置成自己的就可以了

<resources>
    <string name="app_name">HelloFacebookSample</string>
    <string name="cancelled">Cancelled</string>
    <string name="permission_not_granted">Unable to perform selected action because permissions were not granted.</string>
    <string name="ok">OK</string>
    <string name="hello_user">Hello %1$s!</string>
    <string name="success">Success</string>
    <string name="successfully_posted_post">Successfully posted \'%1$s\'.\nPost ID: %2$s</string>
    <string name="error">Error</string>
    <string name="status_update">Updating status for %1$s at %2$s</string>
    <string name="photo_post">Photo Post</string>
    <string name="you_picked">You picked:</string>
    <string name="no_friends_selected"><No friends selected></string>
    <string name="no_place_selected"><No place selected></string>
    <string name="pick_seattle_place">Pick a Seattle Place</string>
    <string name="app_id">574439445908505</string>
</resources>



结果




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值