I'm trying to access google drive through my android app for a specific account. In addition, I also have sign in with google option, so that users can login to the app through google+ and this will be the google account which play services is using.
However, I want to store some files on a specific google drive account say [email protected]. I tried using the GoogleAPIClient by specifying DRIVE API, required scopes and an account name as '[email protected]', which looks something like below:
serviceClient = new GoogleApiClient.Builder(this)
.addApi(Drive.API)
.setAccountName("[email protected]").addConnectionCallbacks(this)
.addScope(Drive.SCOPE_FILE)
.addOnConnectionFailedListener(this)
.build();
serviceClient.connect();
But, I'm getting an error :
The specified account does not exist on this device. Please choose different account.
How can I connect to specific/static account of google to access drive APIs.
Thanks Saurabh