I've been working on an Android App that uses Google Drive API. It was originally build from the quickstart example here. The simplified sequence of API calls (with proper error handling not shown here) is:
GoogleAccountCredential cred = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE_FILE);
cred.setSelectedAccountName("...");
Drive drvSvc = new Drive.Builder (AndroidHttp.newCompatibleTransport(), new GsonFactory(), cred).build();
FileList gooLst = drvSvc.files().list().setMaxResults(MAX_DOWN).setQ(_rqst).execute();
It has been working fine and I am just about to release my App. But suddenly, after Drive API update, I'm getting a warning
The method usingOAuth2(Context, String, String...) from the type
GoogleAccountCredential is deprecated
What's happening? Is there another way to obtain credentials? Is there an edited version of quickstart example available anywhere?
Thanks in advance for any clarification. sean
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…