My goal is to have a folder on the user's drive where he can drop files. My Android application should then detect (via polling) that a new file was created/uploaded in this folder on the drive and download it.
So far so good. I tried to do this with the Google Drive Android API, but I was given to understand that with the Google Drive Android API I do only have access to files created by my application. So if the user were to drop a photo in this folder via another device (e.g. desktop computer), I would not even see the file, let alone if it was newly created or not.
I was told that I could use the Google Drive REST API (v3) to extract the changes that happened since I last looked.
Drive.Changes.List request = drive.changes().list(startPageToken);
ChangeList changes = request.execute();
This does actually work. However, I have three problems with this approach:
- I do get a list of changes containing all the files that changed on the drive. I do not, however, get a changeset. I do not know exactly what has changed. Was it a rename, creation, move, deletion, content change? I googled and I seem to be the only one wondering about this. How do I know what exactly changed?
- As I described I would like to watch a single folder. How can I request the changes for only a single folder?
- And finally: my application is using the native Google Drive Android API. So with adding this feature I suddenly need two APIs instead of one, even though I need one of them only for the simple task of polling for changes. What makes it even worse is that the user could in theory log into one API with one account, and into the other with another account. This does not make any sense. I get a lot of additional overhead and a critical functionality depends on the user logging in with the same account twice. Is there a solution to this problem?
I find it very frustrating that there are two Google Drive APIs avilable to begin with. You have to dig quite a bit to even get started and discover the exact difference if you know nothing initially. I still do not get the difference or why one of them is not capable to see files not created by itself.