Hello android enthusiast, i'm struggling to find solution to this problem. I'm planning to access the user's Google Calendar and Google Documents,(using google-api-java-client-v1.6.0). I can access the user's Google account through AccountManager but I didn't mess up on requesting authToken to authenticate the user for this reason:
How will I handle multiple authToken request for Docs and Cal in a single Activity when the user confirms the application to access his Google Accounts?
In my application, Google Docs and Cal are on different tabs running on background the moment user allows the access of user's account.
any link tutorials would be greatly appreciated.
TYIA.
If I interpret you correctly, you are wondering how to handle the fact that you need one authToken for Calendar, and one authToken for Docs?
Looking at some sample code for using the client libraries, could you do something like this:
When you do this the first time, the user will get a popup requesting access to his Calendar. Once approved, another popup should appear asking permission for Docs. Once approval is given, the popups never appear again (unless the user maybe re-installs your app). So I don't think you need to worry about anything. Just make sure that you try to get the authTokens the first time in your UI-thread and not in a background process. In a background process, a popup window will not appear.