Do not mix DriveId with ResourceId. Both look like strings, but DriveId is different from ResourceId. See SO 21800257 . In addition, ResourceId is not immediately available, see SO 22874657 .
DriveId usually looks like this:
"DriveId: CAESHDBCMW1RVblahblahahlahblahMYjAUgssy8yYFRTTNKRU55"
whereas ResourceId is more like:
"UW2ablahblaghblahNy00Ums0B1mQ"
UPDATE:
Since many developers are struggling with this problem, I will try to work as deep as it allows me.
Google Drive Google Play Svcs YourApp (up in the cloud) (on your device) (on your device) +--------------------+ +--------------+ +--------------+ | 'id' (RESTful API) | - - -> ResourceId - - - -> ResourceId | +--------------------+ | DriveId - - - -> DriveId | +--------------+ +--------------+
What I'm trying to convey using the artistic expression above is:
- When you create a disk object (folder / file) on your device, GooPlaySvcs will provide you with DriveId
- You can use this DriveId for local communication with GooPlaySvcs, you can cache it, etc.
- Per Daniel user comment on SO 21800257 (link above), do not rely on DriveId as a constant line, it supposedly changes to an object that is being executed. Use DriveId.equals () (I have not tested this)
- At any time, when you go beyond the local device (Drive web interface, other applications, YourApp on another device), you need to use the ResourceId, which is the only unique identifier on the Disk (above in the cloud: -).
- ResourceId is available for your AFTER. GoOPlaySvcs transfers the object to disk. There are ways to force it, but this is a completely different story (searching for a Sync () request).
If you decide to capture the ResourceId and use it for RESTfull calls ( delete / trash ), keep in mind the fact that Google Play services distribute their changes on a schedule that you do not control (so it seems to see requestSync () again ), and your REST / GDAA fight can damage your data. GDAA (GooPlayServices) may not be aware of your REST changes for a while. You have to manage the synchronization yourself. I admit that I failed when I tried.
Luck
seanpj
source share