1
votes

Does anyone know, if google still plans to implement a delete functionality to their google drive android api?

To my astonishment, when implementing the last piece of some automatically scheduled 'cloud-backup' code using the 'drive android api' (using the latest Google Play service version, revision 22), I discovered that I was not able to delete files.

I found this hack here on stackoverflow, to mix in the 'Drive API Client Library for Java' for the delete part. I don't like this idea and would like to avoid this solution. Additionally someone from google posted in January 2014 that a delete/trash functionality was 'coming soon' and it's March 2015 now...

Does anyone have a update/solution on this?

EDIT 24 March 2015: The delete call is now natively supported by the Google Android Drive API. You just need to update your Play services lib to revision >= 23. Details: https://developers.google.com/drive/android/trash

1
Please read this answer to [SO 29034693][1]. [1]: stackoverflow.com/questions/29034693/… - seanpj
... and Burcu Dogan is not 'some google guy' :-). She's the one who originally took care of the demo code. But I think she's gone to the 'golang' universe now. - seanpj
Thanks for your input. The answer you linked, suggests exactly the 'hack' I was talking about above: Mixing the drive android api with the vanilla java drive api. I tried it today and it works, but I don't like this 'mixed' solution, as it needs additional app permissions & 6 additional jars. - darksaga
Luckily I can do the following in my code: if(driveFile exists){'update existing driveFile with new contents using DriveFile.MODE_WRITE_ONLY'}else{create new driveFile with new contents}. I also tried this approach today and it works smoothly and I like this solution much better (no additional jar dependencies). About the 'google guy': I looked at the stackoverflow profile & the linked twitter account, seems it was a 'google gal' with a first name I've never heard of ;-) - darksaga
The ability to trash Drive Resources is now available in GDAA: developers.google.com/drive/android/trash However at this time to delete you should still use GDJA. - Arthur Thompson

1 Answers

2
votes

UPDATE:

Delete is supported in the Google Drive Android API as of Google Play services 7.5 using the DriveResource.delete() method.

We recommend using trash for user visible files rather than delete, to give users the opportunity to restore any accidentally trashed content. Delete is permanent, and recommended only for App Folder content, where trash is not available.


Delete isn't currently available in the Drive Android API, but we are currently testing the behavior internally. It won't make the next Play services release, but we hope to have it in the one after; unfortunately I can't give a timeframe. Until that time, the Drive Java Client Library is the best way to do delete on Android.

If you have any other feature requests or bugs, we'd appreciate if you could file them against our issue tracker: https://code.google.com/a/google.com/p/apps-api-issues/

That gives requests more visibility to our teams internally, and issues will be marked resolved when we release updates.