BIBEKRBARAL
BIBEKRBARAL

Reputation: 4475

How to share web application with facebook, twitter etc

i made news applicaion in android using RSS feed and now i want to share some news ie i want to upload links from my app to facebook, twitter etc.Is it possible? Thanks

Upvotes: 6

Views: 6631

Answers (2)

Hubert
Hubert

Reputation: 16160

Try this :

findViewById(R.id.btnEnvoyer).setOnClickListener(
            new Button.OnClickListener() {
                public void onClick(View v) {
                    Intent sendMailIntent = new Intent(Intent.ACTION_SEND); 
                    sendMailIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Share_Mail_Subject));
                    sendMailIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.Share_Mail_Text)); 
                    sendMailIntent.setType("text/plain");
                   
                    startActivity(Intent.createChooser(sendMailIntent, "Email / SMS / Tweet ?"));
                }
            }
    );

works just fine in my latest app if you want to test it : Comis Strips in Brussels

=> Hit [Menu], then [Share], then the button [Send Email / SMS / Tweet]=R.id.btnEnvoyer in my layout file to see the alternatives the user can choose from ...

Hope this helps you a bit ...

H.

Upvotes: 8

Sevki
Sevki

Reputation: 3682

Yes it is. Twitter and Facebook has api for you to do those. Take a look at these Twitter Java APIs also checkout the facebook developer page

Upvotes: 2

Related Questions