I use the Implicit Grant Flow in my application. It’s a desktop application and I’m not really familiar with Android coding, so I’m not sure if it will work the same for you.
- Send user to open the URL to authorize with Twitch
- Set the redirect to 127.0.0.1:<someport>
- With a webserver running in your program, deliver a page with a little JavaScript that will grab the token from the
#access_token=URL fragment and redirect to a page that has the token in the URL, so the webserver can see it - Get the token from the URL and deliever another page telling the user you are done (or close the browser if you can easily do that on Android)
Maybe you can also get the token immediately somehow, not quite sure how that works on Android, if you can access the addressbar of the browser when your app started it or something.
If you think you could use code written for a Java desktop application, you can download my code here: https://sourceforge.net/projects/getchatty/files/?source=navbar (Check out Webserver.java and the HTML files in /src/chatty/util)