How to integrate facebook, twitter and google plus to an android app

kaibuki picture kaibuki · Jul 29, 2011 · Viewed 22.3k times · Source

I like to integrate Facebook, twitter and Google plus to my app, so that using the app, user can update their status. Therefore I like to know how this can be done.

Thanks

Answer

Ovidiu Latcu picture Ovidiu Latcu · Jul 29, 2011

I would highly recommend not to use those SDK since they contain a lot of bugs, and are not very reliable as far as I've seen.

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..."));