Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share web application with facebook, twitter etc

Tags:

android

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

like image 361
BIBEKRBARAL Avatar asked Mar 08 '10 09:03

BIBEKRBARAL


2 Answers

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.

like image 117
Hubert Avatar answered Oct 16 '22 13:10

Hubert


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

like image 27
Sevki Avatar answered Oct 16 '22 13:10

Sevki