你好!我尝试在 Android 应用程序中使用 Google Drive API 进行通信,但我发现这个 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);
问题截图: 过时代码截图 - 行号问题