google-drive-android-api

Google Drive Android Api ChangeEvent Listener workings

陌路散爱 提交于 2019-11-26 17:14:55
问题 I am abusing this forum to solicit explanation (from the GDAA support team) of intended use of GDAA Notification Feature. The documentation here is quite sufficient to implement it, and the two related SO questions 22980497 and 22778501 touch on the same subject. But I can't get my head around it's intended use. Here is the example. Device A 'touches' the Drive object and gets notification immediately. Device B 'touches' the same Drive object and the device A gets notified ' sometime later ',

Google Drive Android API - Check if folder exists

懵懂的女人 提交于 2019-11-26 16:54:13
问题 I'm trying to figure out how to check if a folder exists in Google Drive using the new Google Drive Android API I've tried the following, thinking that it would either crash or return null if the folder is not found, but it doesn't do that (just as long as it is a valid DriveId, even though the folder has been deleted). DriveFolder folder = Drive.DriveApi.getFolder(getGoogleApiClient(), driveId)); If i try to create a file the folder I get from the above code, it does not crash either? I'm

How can I enforce GoogleApiClient to prompt account chooser UI each time I call connect?

独自空忆成欢 提交于 2019-11-26 16:36:44
问题 Whenever I run the code for the very first time at my 1st app launched cycle GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(context) .addApi(Drive.API) .addScope(Drive.SCOPE_APPFOLDER) // required for App Folder sample .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build(); mGoogleApiClient.connect(); I can see the following account chooser. However, if previous connect is success, and I run the same code again for first time at my 2nd app launched cycle .

How to get DriveId of created folder in Google Drive Android API

一曲冷凌霜 提交于 2019-11-26 14:55:27
问题 I have folders on my Google Drive account and i want to add files in specific folder. How can I do it? In example needed DriveId (EXISTING_FOLDER_ID), but I don't know DriveID my folder, I know name only. 回答1: If you have the metadata for the folder (or a DriveFolder object, from which you can get the metadata), you can just call getDriveId. If you have the web resource, you can get the DriveId using that resource id using fetchDriveId 回答2: OK. I experienced the same issue with the Drive

User disconnecting app in Drive causes loss of data under FILE scope

£可爱£侵袭症+ 提交于 2019-11-26 14:47:58
问题 I've run into this issue a few times, but could never point my finger on it, attributing it to GDAA's latency, my buggy code, etc... I finally managed to come up with a scenario where I can safely reproduce it, so I would like to ask people who know if it is a feature I don' understand or a plain bug. If latter is the case, please point me to the place where I can nag about it. I will discuss it on the REST API's background for simplicity. 1/ Let's have a Drive API authenticated app that runs

Trash, Delete in new Google Drive Android API?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 12:31:19
问题 UPDATE (May 2015): the \'trash\' functionality has been implemented in GDAA, making the question below irrelevant. ORIGINAL QUESTION: As I play with the new \"Google Drive Android API\" (GDAA), I am running into a few discrepancies I can\'t figure out. Basically, I have an old app that uses the \"com.google.api.services.drive\" interface (insert, patch, update) and I WOULD LOVE to port it to GDAA. First, GDAA vs. drive.google.com web app. With the old service, I used the DriveScopes.DRIVE

cannot get folderId that i just created on google drive

血红的双手。 提交于 2019-11-26 11:56:23
public class Helpers extends Activity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { SharedPreferences preferences; private static final String TAG = "BaseDriveActivity"; public static String EXISTING_FOLDER_ID; protected static final int REQUEST_CODE_RESOLUTION = 1; protected static final int NEXT_AVAILABLE_REQUEST_CODE = 2; public static final String folderId = "FOLDER_ID"; public static final String fileName = "folderId"; private GoogleApiClient mGoogleApiClient; @Override protected void onResume() { super.onResume(); if (mGoogleApiClient ==

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

老子叫甜甜 提交于 2019-11-26 06:07:29
问题 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. 回答1: 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:

Unpredictable result of DriveId.getResourceId() in Google Drive Android API

陌路散爱 提交于 2019-11-26 01:30:05
问题 The issue is that the \'resourceID\' from \' DriveId.getResourceId() \' is not available (returns NULL) on newly created files (product of \' DriveFolder.createFile(GAC, meta, cont) \'). If the file is retrieved by a regular list or query procedure, the \'resourceID\' is correct. I suspect it is a timing/latency issue, but it is not clear if there is an application action that would force refresh. The \' Drive.DriveApi.requestSync(GAC) \' seems to have no effect. 回答1: UPDATE (07/22/2015)