How to tweet from Android app?

一笑奈何 提交于 2019-12-18 13:19:53

问题


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:


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



来源:https://stackoverflow.com/questions/5741818/how-to-tweet-from-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!