TruckMuncher/TruckMuncher-Android — pull request #8 by MariusVolkhart (2014-10-05 23:57:34+00:00)
Title: Account manager - DO NOT MERGE

@nockertsb This adds infrastructure to integrate with Android's AccountManager.

There are 2 commits. The first is just the AccountManager stuff. It won't compile on it's own. The second has the changes that are likely going to conflict with whatever you're doing. Probably will be easiest to cherry-pick the first commit into your branch at some point, but you have the second one for reference.

Typically the AccountManager is used when your system has it's own OAuth mechanism. In our case, we're going to skipp all the password stuff and just make it handle the tokens we need for us. We'll still need to do what we have been to log the person in using facebook or twitter, but then we'll store the creds in the AccountManager. The AccountManager handles all the logic of "are you logged in, if not, lets log you in, etc".

Hope this all makes sense. Let me know if not.

You can build and run this branch. In the app you won't see anything different, but if you go to your system settings and add an account, you'll see we're now listed there and you can try that out.