开发者

facebook through android

I want to connect my users to signin in facebook through my app. I did some google and some people are saying use fbrocket where as some http://github.com/facebook/facebook-android-sdk.git. I want suggestions 1) which one is easy to implement? 2) what is the difference between them? 3) Why I need to install a jar. Can I achieve this using som开发者_开发问答e Facebook Api?

Any suggestion is much appreciated.

Thanks rachana.


As Cristian said, fbrocket predates the official SDK and is more or less obsoleted by the official SDK, which is newer, shinier, and mostly based on newer longer-support-lived standards like OpenGraph and OAuth. FBRocket is supposedly being rewritten for these, but there's no release for that yet AFAIK. There's a few things the official SDK is still missing (photo uploading, for instance) but if you just want sign-in-via-facebook, it's definitely the way to go.

I'm not sure I understand your 3rd question though -- you need to include Facebook code, either by a jarfile, android library include, or copy-paste -- in order to actually call the Facebook APIs. The Facebook project is open source; if you're not comfortable including it wholesale, you can freely yank out the bits you need. For example, I've used it in projects that only needed authentication and not publishing, customizing the auth dialog handline and removing all the non-login-related code. You could roll your own implementation based on authenticating via OAuth2 and call all the endpoints yourself, but why bother when Facebook already did the work of giving you the code to do that from Android already?


I recommend to use http://github.com/facebook/facebook-android-sdk.git since it's official and it's updated regularly (it's also really easy to implement and it comes with a couple of nice examples). On the other hand FBRocket seems to be out of date, and the developers are still working on the support for Facebook Graph API.


This is facebook's developer info page, the link you gave seems to be the official Android API.
The jar is the actual library that speaks with facebook.


What action on Facebook are you trying to perform? If you are only trying to allow the user to post content from your application to their facebook page you do this

private static final String FACEBOOK_URL = "http://www.facebook.com/sharer.php?u=

try { Uri uri = Uri.parse(FACEBOOK_URL + yourcontent + "&src=sp");

Intent intent = new Intent(Intent.ACTION_VIEW, uri);

startActivity(intent); } catch (Exception e) { e.printStackTrace(); }

}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜