com.google.android.gms.drive.DriveApi |
Note: The Google Drive Android API is currently in developer preview. Applications compiled using this version of the API will continue to operate on devices using future versions of Google Play services; however, changes to the API are expected in future releases.
The main entry point for interacting with Drive. This class provides methods for obtaining a reference to a file or folder, or querying across the entire Drive.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DriveApi.ContentsResult | Result that contains a Contents reference. | ||||||||||
DriveApi.IntentSenderResult | Result that contains an IntentSender reference. | ||||||||||
DriveApi.MetadataBufferResult | Result that contains a MetadataBuffer. | ||||||||||
DriveApi.OnContentsDiscardedCallback | A callback that provides the result for a discardContents(GoogleApiClient, Contents) request. |
||||||||||
DriveApi.OnNewContentsCallback | A callback that provides the result for a OpenContents request. | ||||||||||
DriveApi.OnSyncFinishCallback | A callback that provides the result for a requestSync(GoogleApiClient) request. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes the provided contents without saving the results.
| |||||||||||
Retrieves a
DriveFile object that can be used to interact with the file specified by
the provided DriveId. | |||||||||||
Retrieves a
DriveFolder object that can be used to interact with the folder specified
by the provided DriveId. | |||||||||||
Retrieves a
DriveFolder object that can be used to interact with the root folder. | |||||||||||
Retrieves a new contents instance that can be used to provide initial contents for a new
file.
| |||||||||||
Creates a builder for a Create File activity where a user can select a file name and
destination for a new file in their Drive with the contents and additional metadata provided
in the builder.
| |||||||||||
Creates a builder for an Open File activity that allows user selection of a Drive file.
| |||||||||||
Retrieves a collection of metadata for the files and folders that match the specified query.
| |||||||||||
Requests synchronization a
PendingResult that is ready when synchronization has
completed. |
Closes the provided contents without saving the results.
apiClient | The GoogleApiClient to service the call. The client must be
connected before invoking this method. |
---|---|
contents | The contents to discard. |
Retrieves a DriveFile
object that can be used to interact with the file specified by
the provided DriveId.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
Retrieves a DriveFolder
object that can be used to interact with the folder specified
by the provided DriveId.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
Retrieves a DriveFolder
object that can be used to interact with the root folder.
This method will return synchronously, and is safe to invoke from the UI thread.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
Retrieves a new contents instance that can be used to provide initial contents for a new
file. Write the initial contents to the Contents object returned by this request
using the file APIs provided in Contents
.
To be persisted, the contents must be saved by being passed as initial contents to
createFile(GoogleApiClient, MetadataChangeSet, Contents)
or
setInitialContents(Contents)
.
To discard the contents without saving them, invoke
discardContents(GoogleApiClient, Contents)
.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method. |
---|
Creates a builder for a Create File activity where a user can select a file name and destination for a new file in their Drive with the contents and additional metadata provided in the builder.
Creates a builder for an Open File activity that allows user selection of a Drive file.
Upon completion, the result Intent will contain the DriveId
for the selected file.
This activity will authorize the requesting app to interact with the selected file.
Retrieves a collection of metadata for the files and folders that match the specified query.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method. |
---|---|
query | The query that will restrict the contents of the result set. |
Requests synchronization a PendingResult
that is ready when synchronization has
completed.
apiClient | The GoogleApiClient to service the call. The client must be
connected before invoking this method.
|
---|