tags:

views:

53

answers:

3

I'm implementing a news application. I need to implement shared news links on gmail, twitter, or facebook etc. How can I do this?

A: 

You need to access the various APIs for these services.

EDIT: Mistaken! Thanks.

which api services i need to access pls let me know
Praveenb
No you don't need to. There is a way to let Android and other installed Apps handle this for you.
Janusz
+1  A: 

Take a look here, here and here. It looks like you need ACTION_SEND intent.

Konstantin Burov
Thanks for ur support, burov.. i go through the links
Praveenb
+1  A: 

You can use an Intent with the Action SEND to share something. Android will look for every App on the phone that is able to receive this Intent and present a dialog to the user to choose from the Apps. In that way the user only gets the Services he uses. If he uses a Twitter Client that Client will react on a SEND intent, the mail application will react on it, the facebook app also and even something like MeinVZ a german social network will show up if the app is installed, even if you never thought of using this special Nework to share your news. To do this you just need to do something like this:

Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("text/plain");
share.putExtra(Intent.EXTRA_SUBJECT, "Name of the thing to share");
share.putExtra(Intent.EXTRA_TEXT, getText("Text that will be shared");
startActivity(Intent.createChooser(share, "Title of the dialog that will show up"));

For more information take a look at the links Konstantin provided

Janusz