GPlayServices #1: Save to Google Drive
A little snippet to save a file (or some contents) in Google Drive with the Drive API included in the Google Play Services . To use the Google Drive API we have to follow these steps:(this blog doesn't cover these topics) : Set Up Google Play Services SDK Register your app in Google Developers Console to activate the API Now we can build our code. First of all, we have to create an instance of GoogleApiClient using the GoogleApiClient.Builder and implementing the callback interfaces to manage the connection and the authorizations as described in GPlay Service #0 . Our scope is to save a file (an image) choosing a folder in Google Drive. To choose a folder inside our Google Drive we can use the Drive.DriveApi.newOpenFileActivityBuilder() . This method 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. We can use the OnConnected interface to know