How to tweet from Android app?

user718592 picture user718592 · Apr 21, 2011 · Viewed 15.2k times · Source

I am developing an Android application and would like to have the functionality to send message on my twitter account (TWEET). Which APIs are available for this? Code samples will be appreciated.

Answer

gian1200 picture gian1200 · Apr 27, 2012

If you just need to send a tweet, this can help you.

String tweetUrl = "https://twitter.com/intent/tweet?text=PUT TEXT HERE &url="
                        + "https://www.google.com";
Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

If you want to know which parameters are available, check this link https://developer.twitter.com/en/docs/twitter-for-websites/tweet-button/guides/parameter-reference1