google-drive-android-api

Google Drive Android Api ChangeEvent Listener workings

断了今生、忘了曾经 提交于 2019-11-27 15:41:00
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 ', even if both devices are on wifi. So, what is it good for? The app on one particular device knows that

Google Drive Android API - Check if folder exists

痞子三分冷 提交于 2019-11-27 14:40:22
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 clearly having a little hard time understanding how this new API works all to together, especially with

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

こ雲淡風輕ζ 提交于 2019-11-27 13:45:36
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() . What am I missing this time? Just call mGoogleApiClient.clearDefaultAccountAndReconnect(); have a

Android Google drive App data folder return empty when I use queryChildren

我的未来我决定 提交于 2019-11-27 11:39:19
问题 I'm using the new Google play service drive api to implement backup and restore data with App folder in my android application.I followed the intructions from the google drive developer guides.I can backup and restore data successfully when I only use one device and don't uninstall and reinstall the app.But Problem appears when I use two devices or unintall and reinstall the app. Scene 1: I install my app on one device and backup data to "App folder" succeed and I can see the data size of my

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

不羁的心 提交于 2019-11-27 09:51:52
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. 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 OK. I experienced the same issue with the Drive demos on Github: https://github.com/googledrive/android-demos At the bottom of the readme, it says: If you actually

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

穿精又带淫゛_ 提交于 2019-11-27 09:33:15
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 under DRIVE_FILE scope com.google.api.services.drive.Drive svc = new Drive.Builder( AndroidHttp

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

六月ゝ 毕业季﹏ 提交于 2019-11-27 09:20:29
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.TRASHED, false) query qualifier, or if I use a filtering construct on the results for (Metadata md : result

How to acknowledge when user doesn't want to connect to Google Play Services?

烂漫一生 提交于 2019-11-27 08:40:52
问题 If a user who is prompted to let my app access their Google Drive account hits "cancel," is there a way to acknowledge that they clicked cancel? Right now my application continuously asks them to choose a Google Drive account to use. This is the code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // This is the XML for this activity setContentView(R.layout.view_all_timelines_activity); // This is used for authentication and uploading to Google

It's possible to use google drive REST API and Android API in the same project?

混江龙づ霸主 提交于 2019-11-27 08:34:46
问题 I have a project that was build using the google drive android API, but i want to share a file uploaded to my cloud, and I read in another question here that this is just possible using the REST API. So I ask you, there is a way to work with the both API's in the same project? thanks 回答1: Yes, it is possible. Just looking at the this 'Lifecycle of a Drive file', you can imagine your app on top of that picture (Android App) and the REST Api on the bottom (Drive Service). There is a few points

Google Drive Android API Change Notifications not working

試著忘記壹切 提交于 2019-11-27 08:26:51
问题 I am using Google Drive Android API sample and in that sample i am able to create file and folder in Drive but if i want to monitor change events for a file which is cretaed by this app then it is not working. https://github.com/googledrive/android-demos in this sample there is one activity to receive notfiications for change event in a file, which is not working. I am not seeing any notification when i changed metadata of selected file from web. 回答1: Changes from the web are not