google-drive-android-api

DriveFolder.listChildren() not showing all its children

我是研究僧i 提交于 2019-12-19 21:19:45
问题 I am making an app which works with google drive. I need to get a list of ALL files inside a folder, but it seems that it isnt possible: when I call listFiles method() i cant get all files inside a DriveFolder. But not only that, in the list of files I get, there are some files which I deleted previously. I have read that it may be caused by a sync delay because of google play services, but I had selected 'Sync now' option in my account settings so I think that the problem is not caused by

get metadata of all files and folders in Google Drive

假如想象 提交于 2019-12-19 12:53:29
问题 I am implementing Google Drive in one of my Android application. I am able to authenticate. Here in this method I want to list down metadata of all the files and folders. Drive.DriveApi.fetchDriveId(DemoUtil.getGoogleApiClient(), <drive_id>) .setResultCallback(idCallback) But this is not working. It requires drive id, from where I'll get this drive id? Can I get the metadata listing of all files and folder of Google Drive? I am using API of play services. 回答1: First, be aware of the fact,

Can someone provide an up-to-date Android guide for Google Drive REST API v3?

百般思念 提交于 2019-12-18 16:52:27
问题 Myself and many others have been struggling with setting up the Google Drive REST API v3 to work with Android apps. This mainly stems from the fact that the official Google documentation is missing a proper quick start guide for Android and we are left with finding scraps of (outdated and/or confusing) information dotted around - but what is needed is a complete up to date guide aimed at beginners to get us up and running so that they can open and edit files on their Drive, including how to

Files created by the NEW Google Drive Android API (GDAA) not showing up

試著忘記壹切 提交于 2019-12-18 09:27:58
问题 First, everything looked OK until yesterday (Mar 12, 2014). Since about lunch time, files (not folders) created by GDAA are not showing in the Web Drive interface anymore. A few showed up with a considerable delay (3+ hours) and nothing since. The Android GDAA find/search facility shows both the files (including contents) and folders, but the Web Drive has only folders. I use this code to test it, but I've tried the official demo as well with the same result. 回答1: Fixed by emptying the Google

How to identify Drive ID?

青春壹個敷衍的年華 提交于 2019-12-18 09:24:21
问题 The new Google Drive Android API has 2 types of string IDs available, the 'resource' ID and the 'encoded' ID. 'encoded' id from DriveId.encodeToString() "DriveId:CAESHDBCMW1RVVcyYUZKZmRhakIzMDBVbXMYjAUgssy8yYFRTTNKRU55" 'resource' id from DriveId.getResourceId() "UW2aFJfdajB3M3JENy00Ums0B1mQ" In the process I end-up with a string that can contain any one of them (result of some timing issues). My question is: If I need to 'parse' the string in order to identify the type, is there a

How to upload a file to google drive folder using android google drive sdk

谁都会走 提交于 2019-12-18 07:05:03
问题 Using the bellow snippet I am able to access folder which I have already created with the same app. I am using 'com.google.android.gms:play-services-drive:9.0.0' library and referring google drive sample on github. using the sample CreateFolderInFolderActivity.java I am able to create folder inside an existing folder. Instead of creating folder I need to create a file inside existing folder. public class CreateFileInsideFolderActivity extends BaseDemoActivity { private static final String TAG

Listing files and folders of GDrive using Google Drive Api

大憨熊 提交于 2019-12-18 05:29:10
问题 I want to list all files and folders of a directory on Google Drive using Google Drive API. But I am only getting Metadata object of files not of the folders present in the directory. I am using the following code DriveFolder folder = Drive.DriveApi.getRootFolder(getClient()); folder.listChildren(getClient()) .setResultCallback(new ResultCallback < DriveApi.MetadataBufferResult > () {@ Override public void onResult(DriveApi.MetadataBufferResult result) { if (!result.getStatus().isSuccess()) {

How I can create and upload google spreadsheet using android app?

坚强是说给别人听的谎言 提交于 2019-12-17 21:35:47
问题 I have spent too much time on this so I would like to ask about it. I want to create and upload google spreadsheet using android. I know that I should use Drive API to do this. I know how to create file using this API(even excel file) but when setMimeType is set to application/vnd.google-apps.spreadsheet I receive an error on the device: Error while trying to create the file. @Override public void onConnected(Bundle connectionHint) { super.onConnected(connectionHint); // create new contents

How do I switch accounts under the NEW Google Drive Android API

限于喜欢 提交于 2019-12-17 10:55:10
问题 My authorization flow in the new Google Drive Android API is as follows: Menu: SELECT ACCOUNT connect(); onConnectionFailed() result.startResolutionForResult() invokes AccountSelectDialog / DriveAuthorization onConnected() do your stuff Works like a charm. Now repeating with the aim to switch accounts: Menu: SELECT ACCOUNT connect(); onConnected() Here, I have no chance to get to the AccountSelectDialog since I never get onConnectionFailed() with 'result' to invoke startResolutionForResult()

Dependency ignored because of conflict Android studio

你说的曾经没有我的故事 提交于 2019-12-17 07:21:47
问题 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