I am trying to integrate Twitter into my Android Application and can't seem to get Twitter4j to register my app.
Every tutorial and question regarding the issue I've seen for Android have been years old and things seem to have moved on since then.
I followed the steps on this tutorial and used the supplied source code to test connecting to Twitter. Knowing that the Twitter4j version supplied with the source code was out of date I updated it the latest version and snapshot version later on, but all to no avail.
private void loginNewUser() {
try {
Log.i(TAG, "Request App Authentication");
// This line fails with error "Host is unresolved: api.twitter.com:80
mReqToken = mTwitter.getOAuthRequestToken();
Log.i(TAG, "Starting Webview to login to twitter");
WebView twitterSite = new WebView(this);
twitterSite.loadUrl(mReqToken.getAuthenticationURL());
setContentView(twitterSite);
} catch (TwitterException e) {
Log.e("errors", e.getMessage());
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
Of anyone has any working login code using Twitter4j or knows a solution to the problem I'd be grateful to hear from you!