0

Is it possible share a tweet in android without creating a twitter application(without consumer key/secret)?

I know that "Posting to Twitter without authentication is not possible." But is it required to create a twitter application?


I used this method found here:

String url = "http://www.twitter.com/intent/tweet?url=YOURURL&text=YOURTEXT";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

Thanks to Sathya

Community
  • 1
  • 1
Filip Luchianenco
  • 6,912
  • 9
  • 41
  • 63
  • 1
    Use a twitter intent, it'll share via whichever App supports it. http://stackoverflow.com/questions/2077008/android-intent-for-twitter-application/21186753#21186753 Else use a WebView like mentioned here http://stackoverflow.com/q/14317512/92837 - not possible otherwise – Sathyajith Bhat Aug 11 '14 at 11:42
  • thank you. the web view was the simplest method to use. It is exactly what I needed. Make it an answer please. – Filip Luchianenco Aug 11 '14 at 12:06

2 Answers2

1

You cannot authenticate an Android app to Twitter without a Twitter application. So if by "share a tweet" you mean "post a tweet on Twitter" then no, you cannot do that. By "authenticate" Twitter needs to know the application source of the tweet, not just the person performing it.

Jim
  • 10,172
  • 1
  • 27
  • 36
1

Twitter provides web intents, allowing you to tweet without having to create an application. The user, however, must be logged in(else the user will see a log in screen first).

You can create a WebView to open a Tweet Web Intent, or even better to have it open in the browser so that if a user is logged in from the browser, doesn't have to login again. Also, if there are any twitter apps installed, the user will be prompted to tweet from their default twitter app

Community
  • 1
  • 1
Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134