DrivePreferencesApi | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
public interface

# DrivePreferencesApi

com.google.android.gms.drive.DrivePreferencesApi

## Class Overview

The entry point for retrieving and updating Drive preferences. The preferences set by these APIs are applied only to the current user account and the calling application.

## Summary

Nested Classes
interface | DrivePreferencesApi.FileUploadPreferencesResult | Result that contains a `FileUploadPreferences` reference.

Public Methods
abstract PendingResult<DrivePreferencesApi.FileUploadPreferencesResult> | getFileUploadPreferences(GoogleApiClient apiClient) Retrieves the file upload preferences for the file uploads performed by the calling application.
abstract PendingResult<Status> | setFileUploadPreferences(GoogleApiClient apiClient, FileUploadPreferences fileUploadPreferences) Sets the file upload preferences for the file uploads performed by the calling application.

## Public Methods

#### public abstract PendingResult<DrivePreferencesApi.FileUploadPreferencesResult> getFileUploadPreferences (GoogleApiClient apiClient)

Retrieves the file upload preferences for the file uploads performed by the calling application. These preferences control how the files that are created or edited by the calling application are uploaded to the server from the current device. If the calling application regularly uploads large files in the user's Drive, it is advisable to use these preferences to control when the files should be uploaded to the server (based on network connectivity or battery usage, etc.). See `FileUploadPreferences` for more details.

##### Parameters

apiClient | The `GoogleApiClient` to service the call.

##### Returns

- A PendingResult which can be used to retrieve `FileUploadPreferences`.

#### public abstract PendingResult<Status> setFileUploadPreferences (GoogleApiClient apiClient, FileUploadPreferences fileUploadPreferences)

Sets the file upload preferences for the file uploads performed by the calling application. These preferences control how the files that are created or edited by the calling application are uploaded to the server from the current device. If the calling application regularly uploads large files in the user's Drive, it is advisable to use these preferences to control when the files should be uploaded to the server (based on network connectivity or battery usage, etc.). See `FileUploadPreferences` for more details.

Note that the preferences will be applied to both future and pending file uploads performed by the application. For example, if the application sets the preferences to upload only on WiFi, and then uploads a file while the device is on mobile data, the file will not be uploaded at that point. However, if later on the application changes the preferences to upload on WiFi or mobile data, then the file becomes eligible to be uploaded.

##### Parameters

apiClient | The `GoogleApiClient` to service the call. The client must be connected before invoking this call.
fileUploadPreferences | The preferences to set for file upload operations.

##### Returns

- A PendingResult which can be used to retrieve `FileUploadPreferences`.