Hi Guys I have gone through various links over twitter implementation.
I'm successfully able to tweet and get my followers from twitter. Now the next task is to follow us functionality of twitter in my app. Can anyone tell me the simple way to implement it.
I'm stuck from last one day. Not able to get rid of this. Please dont take this question for voting down and various things. It would be great if someone can provide me any sample code url and straight way answer to it.
Here's the links I have gone through:
https://dev.twitter.com/docs/follow-button
https://dev.twitter.com/discussions/9515
Please help me to get rid of this problem.
harry
I find out solution. I am successfully able to follow any user. Following is link that is working absolutely fine. http://code.google.com/p/android-hackathon-in-fukuoka/source/browse/trunk/sodefuri/src/jp/jagfukuoka/sodefuri/TimeLineActivity.java?spec=svn167&r=167
CODE:--
new TwitterTestAsync().execute(); // CALL THIS CLASS IN YOUR MAIN (CREATE) METHOD.
private class TwitterTestAsync extends AsyncTask<Void, Void, Void>{
@Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
try{
doTwitterTask();
}catch(Exception e){
e.printStackTrace();
}
return null;
}
}
private void doTwitterTask(){
screenName = "chetan_bhagat";
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey("WRITE HERE YOUR CONSUMER KEY")
.setOAuthConsumerSecret("WRITE HERE YOUR CONSUMER SECRET KEY")
.setOAuthAccessToken("WRITE YOUR TOKEN STRING")
.setOAuthAccessTokenSecret("WRITE YOUR TOKEN SECRET STRING");
TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
try {
twitter.createFriendship(screenName);
} catch (TwitterException e) {
e.printStackTrace();
}
}