enfix
enfix

Reputation: 6970

Facebook and Twitter integration in android

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

Answers (2)

Chirag
Chirag

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

Related Questions