How to tweet from Android app?

2019-02-05 00:27发布

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.

1条回答
Summer. ? 凉城
2楼-- · 2019-02-05 01:07

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://dev.twitter.com/docs/tweet-button

查看更多
登录 后发表回答