Skip to content Skip to sidebar Skip to footer

How To Get Oauth Token From Googleapiclient

I am trying to build an Android application that created a spreadsheet in Google Drive and then adds some data to it. I can successfuly create the spreadsheet using the Google Driv

Solution 1:

Yes you can just use

GoogleAccountCredential mCredential;
String[] SCOPES = {"https://www.googleapis.com/auth/userinfo.profile"};

     mCredential = GoogleAccountCredential.usingOAuth2(mContext, Arrays.asList(SCOPES))
                    .setBackOff(newExponentialBackOff())
                    .setSelectedAccountName(ACC_NAME);

        GoogleAuthUtil.getToken(mContext, mCredential.getSelectedAccountName(),SCOPE)

GoogleAuthUtil.getToken

Solution 2:

Post a Comment for "How To Get Oauth Token From Googleapiclient"