I want to be able to
- select a folder in Google Drive (alternatively, I can just Copy/Paste the Drive ID because this application is only for my needs for the moment)
- Read files metadata in this folder
- Download content of those files (spreadsheet)
I tried to use Google Drive API which is pretty simple, but this restriction is a problem for me:
Note: The Android Drive API only works with the https://www.googleapis.com/auth/drive.file scope. This means that only files which a user has opened or created with your application can be matched by a query.
Indeed, the Drive folder and files (spreadsheet) I want to read or download are not created by the application. https://www.googleapis.com/auth/drive.readonly would be perfect for my needs, but it’s only usable with Google Drive REST API.
This is where my problems begins:
First, I tried to run the REST DEMO Master project. With some updates in the gradle it works fine. So, I tried to create a new project (API 23, no activity) and I simply copy/paste files from REST DEMO Master project. I ran this new project and it threw this exception:
UNSPECIFIED GOOGLE DRIVE FAILURE - the name must not be empty: null
As the code is the same, I suppose that the problem comes from conflicts between API Version or project configuration (I’m pretty new to android development and not comfortable with Gradle), and I can't use this code in my existing project.
I read this thread (and many others), I spent hours trying different solutions but I’m really stuck and I can’t find a way to make that work.
What is the best way to connect to a GDrive folder and read content of files not created by the application? Any help would be really appreciated!
NB: I generated the signing certificate fingerprint (SHA1) and registered the application.