The official supporting Android app for twitter

I am developing an Android application and would like my users to be able to post some information from my application on their Twitter feed. I know how to do this job by creating a VIEW intent and redirecting the user to the Android built-in web browser (thanks to stack overflow!). However, now that there is the official Twitter application, I would like to be able to use twitter activity (if installed) to make a message. However, I cannot find the developer documentation for what is called Twitter Intent for Android. Can someone provide a short example code snippet that includes the intent text to use?

+3
source share
3 answers

Can someone provide a short snippet of sample code that includes the intention to use this text?

The official Twitter app can support ACTION_SEND Intenthow Twidroid does. If so, this blog post describes a basic technique (skip any formatting issues).

+4
source

Well, actually ... the best thing you can do is use the twitter4j api: http://twitter4j.org/en/index.html

, , . Twitter, , , .

0

In fact, now you can get the official application in the list:

Intent emailIntent = new Intent(Intent.ACTION_SEND);  
//emailIntent.setType("message/rfc822"); // This was restricting it
emailIntent.setType("text/plain"); // The twitter app is receptive to this
0
source

Source: https://habr.com/ru/post/1746932/


All Articles