【发布时间】:2020-04-27 10:37:14
【问题描述】:
您好,我尝试在 android 应用程序上与 google drive api 进行通信,但我看到这已被 google 弃用,我该如何解决我的代码?
void fun(GoogleSignInAccount signInAccount){
Log.d("jjj","fun called");
GoogleAccountCredential credential =
GoogleAccountCredential.usingOAuth2(
this, Collections.singleton(DriveScopes.DRIVE_FILE));
credential.setSelectedAccount(signInAccount.getAccount());
Drive googleDriveService =
new Drive.Builder(
AndroidHttp.newCompatibleTransport(),
new GsonFactory(),
credential)
.setApplicationName("Drive API Migration")
.build();
editor.putBoolean("SyncOn",true).commit();
mDriveServiceHelper = new DriveServiceHelper(googleDriveService);
【问题讨论】:
标签: java android google-drive-api