1

I am using Drive.DriveApi and by using DriveApi able to download file but now I have upgraded play-services version i.e. com.google.android.gms:play-services:11.8.0 so Drive.DriveApi.getFile(googleApiClient, driveId) is deprecated so please suggest any solution for it. How can download file from google drive?

My working code

DriveId  driveId = (DriveId) data.getParcelableExtra(OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);

 Log.e(TAG, driveId.getResourceId() + "");

 DriveFile driveFile = Drive.DriveApi.getFile(googleApiClient, driveId);
 driveFile.getMetadata(googleApiClient).setResultCallback(metadataRetrievedCallback);

but now this code is deprecated with the latest update so please suggest any solution.

Maroti
  • 481
  • 1
  • 9
  • 24

1 Answers1

1

First I recommend you to check the Download Files docs in Drive API to know the underlying concepts. Then, for the implementation in Android, check this SO post.

noogui
  • 15,376
  • 3
  • 18
  • 42