<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Android &#8211; OAuth updates to Twitter</title>
	<atom:link href="http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/</link>
	<description>Jump Right Ahead In My Web</description>
	<lastBuildDate>Sun, 01 Jan 2012 22:44:25 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: droidin</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-4035</link>
		<dc:creator>droidin</dc:creator>
		<pubDate>Thu, 07 Jul 2011 21:24:07 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-4035</guid>
		<description>2-nd is easy. You are using default constructor that does not explicitly set buffer size. It&#039;s a warning anyways but you can resolve it by setting buffer size in your code. 
 
1-st may have to do with HTTPS (my gut feeling) </description>
		<content:encoded><![CDATA[<p>2-nd is easy. You are using default constructor that does not explicitly set buffer size. It&#39;s a warning anyways but you can resolve it by setting buffer size in your code. </p>
<p>1-st may have to do with HTTPS (my gut feeling)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charx</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-4034</link>
		<dc:creator>charx</dc:creator>
		<pubDate>Thu, 07 Jul 2011 21:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-4034</guid>
		<description>CODE 
 
public class TestAgainActivity extends Activity { 
 
    private String CONSUMER_KEY = &quot;xxxxx&quot;; 
    private String CONSUMER_SECRET = &quot;xxxxxxxxxxxx&quot;; 
    private String CALLBACK_URL = &quot;myapp://twit&quot;; 
    private OAuthConsumer consumer;  
    private OAuthProvider provider; 
    private String authUrl; 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
        setContentView(R.layout.main); 
         
        Button loginButton = new Button(this); 
        loginButton = (Button)findViewById(R.id.button1); 
        loginButton.setOnClickListener(login); 
         
        consumer = new CommonsHttpOAuthConsumer(   
                CONSUMER_KEY, CONSUMER_SECRET);   
                   
        provider = new DefaultOAuthProvider( 
                &quot;https://api.twitter.com/oauth/request_token&quot;, 
                &quot;https://api.twitter.com/oauth/access_token&quot;,   
                &quot;https://api.twitter.com/oauth/authorize&quot;);   
         
    } 
    private OnClickListener login = new OnClickListener() { 
        public void onClick(View v) { 
            AskOauth(); 
        }            
 
    }; 
 
    public void AskOauth(){ 
     
    try { 
             
            authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL); 
             
//     Here i store the Consumer token and tokenSecret 
            SharedPreferences savedTokens = getSharedPreferences(&quot;savedTokens&quot;, 0); 
            SharedPreferences.Editor editor = savedTokens.edit(); 
            editor.putString(&quot;savedToken&quot;, consumer.getToken()); 
            editor.putString(&quot;savedTokenSecret&quot;, consumer.getTokenSecret()); 
            editor.commit(); 
             
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl))); 
 
        } catches{ 
} 
     
    } 
     
    @Override 
    protected void onResume() { 
        // TODO Auto-generated method stub 
        super.onResume(); 
         
        SharedPreferences savedTokens = getSharedPreferences(&quot;savedTokens&quot;, 0); 
        String saved_token = savedTokens.getString(&quot;savedToken&quot;, &quot;empty ShP&quot;); 
        String saved_tokenSecret = savedTokens.getString(&quot;savedTokenSecret&quot;, &quot;empty ShP&quot;); 
        consumer.setTokenWithSecret(saved_token, saved_tokenSecret); 
        
        System.out.println(&quot;consumer token &quot;+consumer.getToken()); 
        System.out.println(&quot;consumer tokenSecret &quot;+consumer.getTokenSecret()); 
       
Uri uri = this.getIntent().getData();   
       
         
        if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACK_URL)) { 
         
        SharedPreferences savedTokens = getSharedPreferences(&quot;savedTokens&quot;, 0); 
        String saved_token = savedTokens.getString(&quot;savedToken&quot;, &quot;empty ShP&quot;); 
  String saved_tokenSecret = savedTokens.getString(&quot;savedTokenSecret&quot;, &quot;empty ShP&quot;); 
        consumer.setTokenWithSecret(saved_token, saved_tokenSecret); 
             
            String verifier = uri.getQueryParameter(OAuth.OAUTH_VERIFIER);   
             
            try { 
 
//Here i sometime get the error!  
provider.retrieveAccessToken(consumer, verifier); 
AccessToken accesToken = new AccessToken(consumer2.getToken(), consumer2.getTokenSecret()); 
 
Twitter twitter = new TwitterFactory().getInstance(); 
twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET); 
              twitter.setOAuthAccessToken(accesToken); 
              Date d = new Date(System.currentTimeMillis()); 
              String tweet = &quot;This message is tweeted &quot; + d.toLocaleString(); 
              try { 
twitter.updateStatus(tweet); 
} catch (TwitterException e) { 
// TODO Auto-generated catch block 
e.printStackTrace(); 
}       
 </description>
		<content:encoded><![CDATA[<p>CODE </p>
<p>public class TestAgainActivity extends Activity { </p>
<p>    private String CONSUMER_KEY = &quot;xxxxx&quot;;<br />
    private String CONSUMER_SECRET = &quot;xxxxxxxxxxxx&quot;;<br />
    private String CALLBACK_URL = &quot;myapp://twit&quot;;<br />
    private OAuthConsumer consumer;<br />
    private OAuthProvider provider;<br />
    private String authUrl; </p>
<p>    @Override<br />
    public void onCreate(Bundle savedInstanceState) {<br />
        super.onCreate(savedInstanceState);<br />
        setContentView(R.layout.main); </p>
<p>        Button loginButton = new Button(this);<br />
        loginButton = (Button)findViewById(R.id.button1);<br />
        loginButton.setOnClickListener(login); </p>
<p>        consumer = new CommonsHttpOAuthConsumer(<br />
                CONSUMER_KEY, CONSUMER_SECRET);   </p>
<p>        provider = new DefaultOAuthProvider(<br />
                &quot;https://api.twitter.com/oauth/request_token&quot;,<br />
                &quot;https://api.twitter.com/oauth/access_token&quot;,<br />
                &quot;https://api.twitter.com/oauth/authorize&quot;);   </p>
<p>    }<br />
    private OnClickListener login = new OnClickListener() {<br />
        public void onClick(View v) {<br />
            AskOauth();<br />
        }            </p>
<p>    }; </p>
<p>    public void AskOauth(){ </p>
<p>    try { </p>
<p>            authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL); </p>
<p>//     Here i store the Consumer token and tokenSecret<br />
            SharedPreferences savedTokens = getSharedPreferences(&quot;savedTokens&quot;, 0);<br />
            SharedPreferences.Editor editor = savedTokens.edit();<br />
            editor.putString(&quot;savedToken&quot;, consumer.getToken());<br />
            editor.putString(&quot;savedTokenSecret&quot;, consumer.getTokenSecret());<br />
            editor.commit(); </p>
<p>            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl))); </p>
<p>        } catches{<br />
} </p>
<p>    } </p>
<p>    @Override<br />
    protected void onResume() {<br />
        // TODO Auto-generated method stub<br />
        super.onResume(); </p>
<p>        SharedPreferences savedTokens = getSharedPreferences(&quot;savedTokens&quot;, 0);<br />
        String saved_token = savedTokens.getString(&quot;savedToken&quot;, &quot;empty ShP&quot;);<br />
        String saved_tokenSecret = savedTokens.getString(&quot;savedTokenSecret&quot;, &quot;empty ShP&quot;);<br />
        consumer.setTokenWithSecret(saved_token, saved_tokenSecret); </p>
<p>        System.out.println(&quot;consumer token &quot;+consumer.getToken());<br />
        System.out.println(&quot;consumer tokenSecret &quot;+consumer.getTokenSecret()); </p>
<p>Uri uri = this.getIntent().getData();   </p>
<p>        if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACK_URL)) { </p>
<p>        SharedPreferences savedTokens = getSharedPreferences(&quot;savedTokens&quot;, 0);<br />
        String saved_token = savedTokens.getString(&quot;savedToken&quot;, &quot;empty ShP&quot;);<br />
  String saved_tokenSecret = savedTokens.getString(&quot;savedTokenSecret&quot;, &quot;empty ShP&quot;);<br />
        consumer.setTokenWithSecret(saved_token, saved_tokenSecret); </p>
<p>            String verifier = uri.getQueryParameter(OAuth.OAUTH_VERIFIER);   </p>
<p>            try { </p>
<p>//Here i sometime get the error!<br />
provider.retrieveAccessToken(consumer, verifier);<br />
AccessToken accesToken = new AccessToken(consumer2.getToken(), consumer2.getTokenSecret()); </p>
<p>Twitter twitter = new TwitterFactory().getInstance();<br />
twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);<br />
              twitter.setOAuthAccessToken(accesToken);<br />
              Date d = new Date(System.currentTimeMillis());<br />
              String tweet = &quot;This message is tweeted &quot; + d.toLocaleString();<br />
              try {<br />
twitter.updateStatus(tweet);<br />
} catch (TwitterException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charx</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-4033</link>
		<dc:creator>charx</dc:creator>
		<pubDate>Thu, 07 Jul 2011 21:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-4033</guid>
		<description>I get the error &quot; Requrest token or token secret not set in server reply. The service provider you use is probably buggy. &quot; when calling the  
 
provider.RetrieveAccesstoken(comsumer, verifier); 
 
But the weird thing is i only get this error sometimes. first my code worked en i posted a message. Then the next day i tried to reinstall the app on my  
 
home computer i got this error. back at my work station i got the same error again but after pressing the button to get permission it worked again and  
 
posted a message on Twitter. What the hell is going on?! could somebody explain? 
 
i also get the notification &quot;Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.&quot;  
 
Does this have to do something with my memory or storing the Token secrets? it sounds like the service is too busy to reply when contacting it. 
 
 </description>
		<content:encoded><![CDATA[<p>I get the error &quot; Requrest token or token secret not set in server reply. The service provider you use is probably buggy. &quot; when calling the  </p>
<p>provider.RetrieveAccesstoken(comsumer, verifier); </p>
<p>But the weird thing is i only get this error sometimes. first my code worked en i posted a message. Then the next day i tried to reinstall the app on my  </p>
<p>home computer i got this error. back at my work station i got the same error again but after pressing the button to get permission it worked again and  </p>
<p>posted a message on Twitter. What the hell is going on?! could somebody explain? </p>
<p>i also get the notification &quot;Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.&quot;  </p>
<p>Does this have to do something with my memory or storing the Token secrets? it sounds like the service is too busy to reply when contacting it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manu_Jangra</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-3994</link>
		<dc:creator>Manu_Jangra</dc:creator>
		<pubDate>Tue, 19 Apr 2011 07:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-3994</guid>
		<description>consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY,CONSUMER_SECRET , SignatureMethod.HMAC_SHA1) </description>
		<content:encoded><![CDATA[<p>consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY,CONSUMER_SECRET , SignatureMethod.HMAC_SHA1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Varun Tewari</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-3964</link>
		<dc:creator>Varun Tewari</dc:creator>
		<pubDate>Tue, 15 Feb 2011 09:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-3964</guid>
		<description>I am also facing this problem. Did you found a way to fix this? 
Thanks in advance :) </description>
		<content:encoded><![CDATA[<p>I am also facing this problem. Did you found a way to fix this?<br />
Thanks in advance :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: droidin</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-3963</link>
		<dc:creator>droidin</dc:creator>
		<pubDate>Sun, 13 Feb 2011 20:06:55 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-3963</guid>
		<description>No Problem. Yes it&#039;s outdated and actually I switched from Signpost to the &quot;official&quot; OAuth implementation but at least this should give some idea of the overall flow </description>
		<content:encoded><![CDATA[<p>No Problem. Yes it&#39;s outdated and actually I switched from Signpost to the &quot;official&quot; OAuth implementation but at least this should give some idea of the overall flow</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kunev</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-3962</link>
		<dc:creator>Kunev</dc:creator>
		<pubDate>Sat, 12 Feb 2011 12:19:29 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-3962</guid>
		<description>I think the OAuth library has changed, probably as a result of the official OAuth 1.0 release. 
Quite a bit of things are different, mostly in method&#039;s agruments, and there are a bunch of unhandled exceptions at several places, but it&#039;s still a pretty useful tutorial. Actually the fact that you havee to fix a few things in order to work with OAuth 1.0 make it even more educational. :) 
Thanks a lot! Great help! :) </description>
		<content:encoded><![CDATA[<p>I think the OAuth library has changed, probably as a result of the official OAuth 1.0 release.<br />
Quite a bit of things are different, mostly in method&#39;s agruments, and there are a bunch of unhandled exceptions at several places, but it&#39;s still a pretty useful tutorial. Actually the fact that you havee to fix a few things in order to work with OAuth 1.0 make it even more educational. :)<br />
Thanks a lot! Great help! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arslan</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-3924</link>
		<dc:creator>Arslan</dc:creator>
		<pubDate>Mon, 10 Jan 2011 07:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-3924</guid>
		<description>Why call back is not working. It give exception Server error 401 ,  
If I do not give anything for call back but OAuth.OUT_OF_BOUND; then if work fine. 
here is my code.... 
public class Tweeter extends Activity { 
 
private String CONSUMER_KEY = &quot;123&quot;; 
private String CONSUMER_SECRET = &quot;123&quot;; 
private static final Uri CALLBACK_URI = Uri.parse(&quot;myapp://callback&quot;); 
private String CALLBACK_URL = &quot;myapp://callback&quot;; 
CommonsHttpOAuthProvider provider ; 
CommonsHttpOAuthConsumer consumer ; 
 
/** Called when the activity is first created. */ 
@Override 
public void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.main); 
 
consumer = new CommonsHttpOAuthConsumer( 
CONSUMER_KEY, CONSUMER_SECRET); 
 
provider = new CommonsHttpOAuthProvider( 
&quot;http://twitter.com/oauth/request_token&quot;, 
&quot;http://twitter.com/oauth/access_token&quot;, 
&quot;http://twitter.com/oauth/authorize&quot;); 
provider.setOAuth10a(true); 
 
HttpClient client = new DefaultHttpClient(); 
 
String authUrl = &quot;http://www.yahoo.com&quot;; 
try { 
 
//This line work perfect but it not redirect me to my application 
authUrl = provider.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND); 
 
System.out.println(&quot;Auth URL 1: &quot;+authUrl); 
 
//I want to send a calll back but It give exception 
authUrl = provider.retrieveRequestToken(consumer, OAuth.OAUTH_CALLBACK); 
 
System.out.println(&quot;Auth URL 2: &quot;+authUrl); 
 
} catch (OAuthMessageSignerException e) { 
// TODO Auto-generated catch block 
e.printStackTrace(); 
} catch (OAuthNotAuthorizedException e) { 
// TODO Auto-generated catch block 
e.printStackTrace(); 
} catch (OAuthExpectationFailedException e) { 
// TODO Auto-generated catch block 
e.printStackTrace(); 
} catch (OAuthCommunicationException e) { 
// TODO Auto-generated catch block 
e.printStackTrace(); 
} 
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl))); 
} 
 </description>
		<content:encoded><![CDATA[<p>Why call back is not working. It give exception Server error 401 ,<br />
If I do not give anything for call back but OAuth.OUT_OF_BOUND; then if work fine.<br />
here is my code&#8230;.<br />
public class Tweeter extends Activity { </p>
<p>private String CONSUMER_KEY = &quot;123&quot;;<br />
private String CONSUMER_SECRET = &quot;123&quot;;<br />
private static final Uri CALLBACK_URI = Uri.parse(&quot;myapp://callback&quot;);<br />
private String CALLBACK_URL = &quot;myapp://callback&quot;;<br />
CommonsHttpOAuthProvider provider ;<br />
CommonsHttpOAuthConsumer consumer ; </p>
<p>/** Called when the activity is first created. */<br />
@Override<br />
public void onCreate(Bundle savedInstanceState) {<br />
super.onCreate(savedInstanceState);<br />
setContentView(R.layout.main); </p>
<p>consumer = new CommonsHttpOAuthConsumer(<br />
CONSUMER_KEY, CONSUMER_SECRET); </p>
<p>provider = new CommonsHttpOAuthProvider(<br />
&quot;http://twitter.com/oauth/request_token&quot;,<br />
&quot;http://twitter.com/oauth/access_token&quot;,<br />
&quot;http://twitter.com/oauth/authorize&quot;);<br />
provider.setOAuth10a(true); </p>
<p>HttpClient client = new DefaultHttpClient(); </p>
<p>String authUrl = &quot;http://www.yahoo.com&quot;;<br />
try { </p>
<p>//This line work perfect but it not redirect me to my application<br />
authUrl = provider.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND); </p>
<p>System.out.println(&quot;Auth URL 1: &quot;+authUrl); </p>
<p>//I want to send a calll back but It give exception<br />
authUrl = provider.retrieveRequestToken(consumer, OAuth.OAUTH_CALLBACK); </p>
<p>System.out.println(&quot;Auth URL 2: &quot;+authUrl); </p>
<p>} catch (OAuthMessageSignerException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
} catch (OAuthNotAuthorizedException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
} catch (OAuthExpectationFailedException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
} catch (OAuthCommunicationException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
}<br />
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kotini</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-3910</link>
		<dc:creator>kotini</dc:creator>
		<pubDate>Mon, 27 Dec 2010 07:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-3910</guid>
		<description>How to post url and images and geo position in  
in BasicNameValuePair </description>
		<content:encoded><![CDATA[<p>How to post url and images and geo position in<br />
in BasicNameValuePair</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naveen</title>
		<link>http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/comment-page-1/#comment-3908</link>
		<dc:creator>Naveen</dc:creator>
		<pubDate>Sun, 19 Dec 2010 11:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://dev.bostone.us/?p=194#comment-3908</guid>
		<description>Would be great if you post the working version of the code. </description>
		<content:encoded><![CDATA[<p>Would be great if you post the working version of the code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

