Reputation: 1311
I want to make an android app which will update status in twitter. I am using signpost-core-1.2.1.1 and signpost-commonshttp4-1.2.1.1 jar files.I have given internet uses permission and i have registered app in twitter giving read,write and direct messages permission. Also filled up the callback Url.But retrieveRequestToken() function throws OAuthCommunicationException.
code snippet:
private static final String CALLBACK_URI = "app://twitter";
private static final String REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token";
private static final String ACCESS_TOKEN_URL = "https://api.twitter.com/oauth/access_token";
private static final String AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize";
String CONSUMER_KEY = "I4bwezijxf6VwpU8x0tygg";
String CONSUMER_SECRET = "Y6vSdZs3zWBrNogXZWSHKZ590RSXqB5wBwj8vFaayk";
private static CommonsHttpOAuthConsumer consumer;
private static CommonsHttpOAuthProvider provider;
consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
provider = new DefaultOAuthProvider(REQUEST_TOKEN_URL,ACCESS_TOKEN_URL, AUTHORIZE_URL);
String authUrl="";
authUrl = provider.retrieveRequestToken(consumer,CALLBACK_URI);
I am totally stuck with this.Please reply.
Upvotes: 0
Views: 98
Reputation: 1934
Your consumer credentials are working fine in my test twitter app, so could not find the issue with you.
Here is the complete detailed article on Twitter integration and you can literally copy the code of TwitterConnectWebActivity in your app and call it by an intent for twitter integration.
Twitter integration in Android app complete code
This must solve your problem.
Upvotes: 1