How to tweet using Android app?
In my application, I need to post tweets, 开发者_Go百科how can I do this? I have found a jar but it's constructor is deprecated.
just use a [SEND Intent][1], that way your users can decided what they want to do with your message:
Intent shareIntent = new Intent( android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,”Sharing info");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ”is very easy this way”);
startActivity(Intent.createChooser(shareIntent, ”Share Track"));
if you only need to post; then the links that parag displayed above; twitter4j and winterwell will suffice.
Otherwise you need to take a look at OAuth, which is a pain. that's twitters (and facebook and LinkedIn and so on) "new" way of confirming users and passwords.
http://apiwiki.twitter.com/w/page/22554657/OAuth-Examples would be useful in that case.
Good luck and have fun! :)
You can send the appropriate Intent
: request for ACTION_SEND
and then limit the eligible intents based on a list of known applications packages.
精彩评论