How to Integrate Twitter Oauth as like Facebook?

梦想的初衷 提交于 2020-01-24 00:36:08

问题


I am new to integrating Twitter. I have implemented Twitter in my application with this code:

         // Create file 
            File picture = new File(APP_FILE_PATH + "/myAwesomeDrawing.png");  
            // Create TwitPic object and allocate TwitPicResponse object 
            TwitPic tpRequest = new TwitPic("username", "password"); 
            TwitPicResponse tpResponse = null;  
            // Make request and handle exceptions                            
            try {         
                tpResponse = tpRequest.uploadAndPost(picture, "Image Uploaded from My AndroidDrawing App...");

                } 
            catch (IOException e) {         
                e.printStackTrace(); 
            } 
            catch (TwitPicException e) {         
                e.printStackTrace(); 
            }  
            // If we got a response back, print out response variables                               
            if(tpResponse != null)         
                tpResponse.dumpVars();

All works fine here. But here I have to add the username and password programmatically. Is there any other way to use the Twitter integration as like Facebook OAuth to integration?

I need to know how Twitter OAuth is checked, and if the User is not login then it will ask for the username and password in its in built window.


回答1:


If caguilar187's code link's are not enough, then here are few more links for code help:

  1. http://blog.doityourselfandroid.com/2011/08/08/improved-twitter-oauth-android/
  2. http://blog.doityourselfandroid.com/2011/02/13/guide-to-integrating-twitter-android-application/
  3. http://marakana.com/forums/android/examples/312.html
  4. Best suggested: http://android10.org/index.php/articleslibraries/291-twitter-integration-in-your-android-application
  5. One more suggest: http://automateddeveloper.blogspot.com/2011/06/android-twitter-oauth-authentication.html
  6. Post on Twitter: http://www.londatiga.net/it/how-to-post-twitter-status-from-android/

  7. GitHub Link: https://github.com/brione/Brion-Learns-OAuth




回答2:


Hope below link help you:-

Below link show you how to generate key with Twitter and other social media

http://code.google.com/p/socialauth-android/wiki/Twitter

Now below link is source code where u find out source code

http://code.google.com/p/socialauth-android/downloads/list




回答3:


here are a few they all use signpost to do it.

Signpost: http://code.google.com/p/oauth-signpost/

Blogs
http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/#awp::2009/07/16/android-oauth-twitter-updates/

http://blog.copyninja.info/2010/09/android-oauth-authentication-with.html

http://code.google.com/p/oauth-signpost/wiki/TwitterAndSignpost



来源:https://stackoverflow.com/questions/8102935/how-to-integrate-twitter-oauth-as-like-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!