Android, AccountManager and OAuth
<p>I'm sure this is basic and I'm missing something. I've read through other answers on SO, I've googled, I've read resources and I just can't wrap my head around what I need to do.</p>

<p>I'm trying to figure out how to write an app that connects to Twitch's API, specifically how to authenticate with Twitch's api. Their documentation is here: <a href="https://github.com/justintv/Twitch-API/blob/master/authentication.md" rel="nofollow">https://github.com/justintv/Twitch-API/blob/master/authentication.md</a></p>

<p>I've created an app and stored my keys.</p>

<p>Now comes the part where I want my user to click a button which launches the authentication on their website. From what I can tell I do this by using an AccountManager. Except... I can't figure out what I'm supposed to do.</p>

<p>Here's the excerpt I've found online:</p>

<pre><code>AccountManager am = AccountManager.get(this);
        Bundle options = new Bundle();

        am.getAuthToken(
                myAccount_,                     // Account retrieved using getAccountsByType()
                "Manage your tasks",            // Auth scope
                options,                        // Authenticator-specific options
                this,                           // Your activity
                new OnTokenAcquired(),          // Callback called when a token is successfully acquired
                new Handler(new OnError()));    // Callback called if an error occurs
</code></pre>

<p>According to twitch's documentation I want to send the user to:</p>

<pre><code>https://api.twitch.tv/kraken/oauth2/authorize
    ?response_type=code
    &amp;client_id=[your client ID]
    &amp;redirect_uri=[your registered redirect URI]
    &amp;scope=[space separated list of scopes]
    &amp;state=[your provided unique token]
</code></pre>

<p>And I simply have no idea how these two things need to be combined.</p>