google-drive-android-api

Google Drive Android API - Invalid DriveId and Null ResourceId

萝らか妹 提交于 2019-11-27 08:05:43
问题 I have been battling this code the whole day without luck. I started by following this code sample from Google. The problem is that the folder gets created successfully but inside onResult() , I always get a DriveId or resourceId that is invalid or incomplete. That means I cannot create a file inside the folder I created. Here is the code I am using: public class CreateFolderActivity extends BaseDemoActivity { @Override public void onConnected(Bundle connectionHint) { super.onConnected

Google OAuth 2.0 and debug key for Google Drive API

我是研究僧i 提交于 2019-11-27 06:30:46
问题 I've set up 2 Client IDs for Android application in the GoogleDriveAPI console: the first for the release APK and the second for Debug purposes. Everything ok with the released app, but my issue is only related to the second Client ID. I'm getting this exception: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException after the following lines: Drive.Files.List request; request = service.files().list(); String query = "mimeType='application/vnd.google-apps.folder'

Dependency ignored because of conflict Android studio

送分小仙女□ 提交于 2019-11-27 04:03:13
I'm trying to add the following dependency but it is ignore. I can't understand how to resolve it please help me Thank you. Dependency compile 'com.google.apis:google-api-services-drive:v2-rev170-1.20.0' Waring for ignoring dependency Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal

Infinite “Choose an account” loop when using Google Drive API

半腔热情 提交于 2019-11-27 03:40:31
问题 I'm trying to set up an Android app that can manipulate files stored on my personal Google Drive account using the guidelines at Google Drive REST API Overview. I've followed the sample code to allow a user to connect to the account, but the "Choose an account" dialog reappears continually regardless of whether an account name is chosen or the cancel button is pressed. I believe the problem is that the refreshResults() method keeps returning null when testing for mCredential

Uploading video to Google Drive programmatically (Android API)

余生颓废 提交于 2019-11-27 02:24:56
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 4 years ago . I have followed the Drive API guide (https://developer.android.com/google/play-services/drive.html) and my app now uploads photos smoothly, but I am now trying to upload videos (mp4) without success. Does anyone know how to achieve this? The video is a newly generated mp4 file and I have the path to where it is stored on the device. For pictures its done

Backup/Restore SQLlite Database to Google Drive app folder

落花浮王杯 提交于 2019-11-27 01:26:06
问题 I am trying to incorporate the functionality to backup and restore the app database to google drives app folder (NOT visible to the user). I went through the basic setup guide setup guide given for android and can get the user to authorize the app and reach to the point where onConnected method is being called. The problem that I am facing is, I am not sure how to go about 'sending' the database file (.db) from device to google drive app folder. Google has shared snippet for creating a new

Get all folders google drive api on Android

て烟熏妆下的殇ゞ 提交于 2019-11-26 23:31:02
问题 I use the new Google drive api and I can't get All folders from my google drive, I only get the folders that I create with the google drive api... Anybody know why happens this? this is my code: @Override protected void onResume() { super.onResume(); if (mGoogleApiClient == null) { // Create the API client and bind it to an instance variable. // We use this instance as the callback for connection and connection // failures. // Since no account name is passed, the user is prompted to choose.

Invalid parent folder error for AppFolder in Drive API

吃可爱长大的小学妹 提交于 2019-11-26 18:24:51
问题 I get an invalid parent folder error, and I've seen the solutions to use resource ID rather than Drive ID, but it's a different scenario here. I'm trying to access the AppFolder, and this just uses the GoogleApiClient like so: this.appFolder = Drive.DriveApi.getAppFolder(mGoogleApiClient); When I later try to create a file in it, I get the above error. DriveFolder.DriveFileResult fileResult = appFolder.createFile(mGoogleApiClient, changeSet, driveContentsResult.getDriveContents()).await();

How to delete a file on google drive using Google Drive Android API

我与影子孤独终老i 提交于 2019-11-26 17:52:14
I'm new to Google Drive Android API, and I'm learning it. But I encountered a problem that is I cannot delete a file using Google Drive Android API, there isn't an example of it. Can anybood help me with this question? Thanks alot. UPDATE (April 2015) GDAA finally has it's own ' trash ' functionality rendering the answer below IRRELEVANT. ORIGINAL ANSWER: As Cheryl mentioned above, you can combine these two APIs. The following code snippet, taken from here , shows how it can be done: First, gain access to both GoogleApiClient , and ...services.drive.Drive GoogleApiClient _gac; com.google.api

Deleted files status unreliably reported in the new Google Drive Android API (GDAA)

杀马特。学长 韩版系。学妹 提交于 2019-11-26 17:49:35
问题 This issue has been bugging me since the inception of the new Google Drive Android Api (GDAA). First discussed here, I hoped it would go away in later releases, but it is still there (as of 2014/03/19). The user-trashed (referring to the 'Remove' action in 'drive.google.com') files/folders keep appearing in both the Drive.DriveApi.query(_gac, query), and DriveFolder.queryChildren(_gac, query) as well as DriveFolder.listChildren(_gac) methods, even if used with Filters.eq(SearchableField