-1

I need that my application publish new status on Twitter and Facebook, but I need to do it without authentificating the user into Facebook or Twitter. I need to use the official Facebook and Twitter applications installed on the phone. First, my application should connect with these applications. After this, my application must checks if the user is logged in with the official Facebook or Twitter applications, and after this, my application must send the new status using the official Facebook and Twitter applications.

Is it possible to do it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
  • it is possible. http://stackoverflow.com/questions/2953146/android-java-post-simple-text-to-facebook-wall – Anonymous Feb 16 '14 at 17:59

1 Answers1

2

Nope, that shouldn't be allowed, because it would permit malicious apps to use other other apps' methods to post or retrieve any kind of information. However, it is possible to use Intent, send to user to the Twitter or Facebook apps with a message and let the user submit it himself.

To use Intent the function below should help you out:

public void share(String subject,String text) {
 final Intent intent = new Intent(Intent.ACTION_SEND);

 intent.setType("text/plain");
 intent.putExtra(Intent.EXTRA_SUBJECT, subject);
 intent.putExtra(Intent.EXTRA_TEXT, text);

 startActivity(Intent.createChooser(intent, getString(R.string.share)));
}

You can also filter what apps will be shown to the user and do some customization: http://www.dev-articles.com/article/Facebook-share-intent-436001

vgardner
  • 507
  • 5
  • 20
  • can you explain how to do it please: "However, it is possible to use Intent, send to user to the Twitter or Facebook apps with a message and let the user submit it himself." – NullPointerException Nov 18 '11 at 12:05