Drive

public final class Drive extends Object

This class is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

The Drive API provides easy access to users' Google Drive contents. This API includes Activities to open or create files in users' Drives, as well as the ability to programmatically interact with contents, metadata, and the folder hierarchy.

Create a client DriveClient or DriveResourceClient to start interacting with Drive. The DriveClient provides access to basic Drive functionality, and the DriveResourceClient provides access to methods that interact with DriveResource objects.

Clients can be created with any of the following methods:

Be sure to pass in at least one of SCOPE_FILE or SCOPE_APPFOLDER when creating the GoogleSignInAccount.

Field Summary

public static final Api<Api.ApiOptions.NoOptions> API This field is deprecated. The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
public static final DriveApi DriveApi This field is deprecated. The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
public static final DrivePreferencesApi DrivePreferencesApi This field is deprecated. The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
public static final Scope SCOPE_APPFOLDER A Scope that gives 'drive.appfolder' access to a user's drive.
public static final Scope SCOPE_FILE A Scope that gives 'drive.file' access to a user's drive.

Public Method Summary

static DriveClient
getDriveClient(Activity activity, GoogleSignInAccount account)
This method is deprecated. The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
static DriveClient
getDriveClient(Context context, GoogleSignInAccount account)
This method is deprecated. The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
static DriveResourceClient
getDriveResourceClient(Activity activity, GoogleSignInAccount account)
This method is deprecated. The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.
static DriveResourceClient
getDriveResourceClient(Context context, GoogleSignInAccount account)
This method is deprecated. The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

Inherited Method Summary

Fields

public static final Api<Api.ApiOptions.NoOptions> API

This field is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

The API necessary to use Drive. Provide this as an API to addApi(Api).

public static final DriveApi DriveApi

This field is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

The entry point for interacting with the Drive APIs which provides ways to access/update the files and folders in users Drive.

public static final DrivePreferencesApi DrivePreferencesApi

This field is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

The entry point for interacting with the Drive APIs which provides ways to access/update Drive preferences.

public static final Scope SCOPE_APPFOLDER

A Scope that gives 'drive.appfolder' access to a user's drive. This scope gives access to files that have been created by the app in the App Folder.

This scope can be provided in requestScopes(Scope, Scope)

public static final Scope SCOPE_FILE

A Scope that gives 'drive.file' access to a user's drive. This scope give per-file access to files that have been created by, or specifically opened with the app.

This scope can be provided in requestScopes(Scope, Scope)

Public Methods

public static DriveClient getDriveClient (Activity activity, GoogleSignInAccount account)

This method is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

Creates a new instance of DriveClient for use in an Activity. Error resolutions will be automatically launched from the provided Activity, displaying UI when necessary. This is the entry point for basic interactions with the Drive API.

public static DriveClient getDriveClient (Context context, GoogleSignInAccount account)

This method is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

Creates a new instance of DriveClient for use in a non-Activity Context. Error resolutions will be automatically launched from the provided Context, displaying system tray notifications when necessary. This is the entry point for basic interactions with the Drive API.

public static DriveResourceClient getDriveResourceClient (Activity activity, GoogleSignInAccount account)

This method is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

Creates a new instance of DriveResourceClient for use in an Activity. Error resolutions will be automatically launched from the provided Activity, displaying UI when necessary. This is the entry point for general management of all DriveResource objects with the Drive API.

public static DriveResourceClient getDriveResourceClient (Context context, GoogleSignInAccount account)

This method is deprecated.
The Google Drive Android API is deprecated and will be turned down on December 6, 2019. See the migration guide for instructions on migrating to the REST API.

Creates a new instance of DriveResourceClient for use in a non-Activity Context. Error resolutions will be automatically launched from the provided Context, displaying system tray notifications when necessary. This is the entry point for general management of all DriveResource objects with the Drive API.