Reputation: 6970
I need to integrate Facebook and Twitter I'm my app: a simple share button.
Is there a library to do this ? Which the best ? Official only !?
Upvotes: 2
Views: 1922
Reputation: 56925
If you just want to share simple text from your app to Facebook or Twitter and so on... I would recommend to create a chooser to let the user pick which app from his phone he wants to user for sharing. It is simpler, more reliable and more the 'android way' of doing it.
Here is the code that you have to write :
Intent shareIntent=new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"I want to share this with you!");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Great Post");
startActivity(Intent.createChooser(shareIntent, "Share..."));
Otherwise As for facebook and twitter, you can do this through their API.
Facebook Sdk for android Developers.
And for Twitter you can use external libraries as written on twitter developer docs, and there is a library called Twitter4J that is android ready.
Upvotes: 3
Reputation: 3277
Check this Following Links
Integrating FaceBook, Twitter, Social networks in Android
How to integrate facebook, twitter and google plus to an android app
http://10jumps.com/blog/android-integration-facebook-and-twitter
Facebook and twitter integration with my android application
Upvotes: 1