I am developing an app in which User can tweet some predefined text. I have read many of tutorials but could not find the proper solution .Can any body please help me to do this via some tutorials or some example.
- i have read londatiga.net/it/how-to-post-twitter-status-from-android , abhinavasblog.blogspot.in/2011/06/…Nitin– Nitin2012-02-17 13:30:09 +00:00Commented Feb 17, 2012 at 13:30
- in the first tutorial 02-17 18:29:56.832: WARN/System.err(1484): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Host is unresolved: api.twitter.com:443 there ia an errorNitin– Nitin2012-02-17 13:31:17 +00:00Commented Feb 17, 2012 at 13:31
3 Answers
Use twitter4j. It works with Android. There are some usage examples.
A direct example on how to tweet on Android (assumes a Twitter account is available on device which means a Twitter client is present): http://blog.radioactiveyak.com/2011/04/using-twitter4j-to-tweet-in-android.html
Comments
If you want to save yourself from the hassles of using twitter4j api where the use of oAuth etc. is required, you can try using a web-intent in a WebView shown in a dialog. Have a look on the following tutorial https://dev.twitter.com/docs/intents
You will be able to tweet once the username and password has been entered and saved. Although the use of Web-Intent might be discouraged, but it's easiest hack you can try.