In examining the Android sample for Core API v2, I was wondering how to properly handle error recovery in the use of AccessToken. In the example, the AccessToken is returned by Auth.getOAuth2Token(), and then stored in Shared Preferences for later use, so as to avoid going through the authentication process again. I assume this AccessToken could persist this way indefinitely, as long as nothing changed. But suppose something did change. Suppose the AccessToken became incorrect, either by some action by the owner of the Dropbox account, or by some mishandling of Shared Preferences. Suppose I then tried to list the contents of a folder using the faulty AccessToken. Where would the error occur? I want to be able to detect this situation and null out my stored version of the AccessToken so that the next access attempt will result in a re-authentication with Dropbox. I don't see where in the example that possibility is provided for.
It looks like the first use of a stored AccessToken is in
sDbxClient = new DbxClientV2(requestConfig, accessToken);
in DropboxClientFactory.java in the sample. Will this fail if accessToken is bad? Or will the failure come later?