com.google.android.gms.drive.DriveApi |
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.DriveIdResult | Result that contains a DriveId. | ||||||||||
DriveApi.IntentSenderResult | Result that contains an IntentSender reference. | ||||||||||
DriveApi.MetadataBufferResult | Result that contains a MetadataBuffer. | ||||||||||
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
DriveId object that can be used in further drive api operations (e.g. | |||||||||||
Retrieves a
DriveFolder object that can be used to interact with the App
Folder. | |||||||||||
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 DriveId
object that can be used in further drive api operations (e.g.
getFile, getFolder).
apiClient | The GoogleApiClient to service the call. |
---|---|
resourceId | The drive resource id for the DriveId to retrieve. |
Retrieves a DriveFolder
object that can be used to interact with the App
Folder. This method will return synchronously, and is safe to invoke from the UI thread.
The AppData scope is required to access this folder. If the app does not have
DRIVE_APPFOLDER
it will return null.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
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.
|
---|