title: Android: How to Twitter oAuth Through Account Manager
body: <p>In my application, I want to use <code>oAuth</code> protocol during login processes for several sites like Twitter, Facebook and more. I've some issues about Twitter oAuth. </p>
  
  <p>I used those lines to access token and secret datas:</p>
  
  <pre><code>AccountManager am = AccountManager.get(MyActivity.this);
  Account[] accounts = am.getAccountsByType("com.twitter.android.auth.login");
  
  if(accounts.length &gt; 0) {
      Account acct = accounts[0];
      am.getAuthToken(acct, "com.twitter.android.oauth.token", null, MyActivity.this, new AccountManagerCallback&lt;Bundle&gt;() {
          public void run(AccountManagerFuture&lt;Bundle&gt; arg0) {
              // Accessing token
          }
      }, null);               
  } else {
      Toast.makeText(getApplicationContext(), "There is no defined account", Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>So I succeed it. But I'm curious about these questions:</p>
  
  <ul>
  <li>Do I need any Twitter application? </li>
  <li>How will I check these tokens or do I have to check? I mean how will I reach users' information like twitter_id ?</li>
  </ul>
  
  <p>Any information would be great.</p>