How to get the file ID so I can perform a download of a file from Google Drive API on Android?

后端 未结 7 1299
[愿得一人]
[愿得一人] 2020-12-29 04:37

I am working on an Android project and I am trying to make use of the Google Drive API and I\'ve got most of it working but I am having an issue in how I perform a download.

7条回答
  •  醉话见心
    2020-12-29 05:05

    Well the first option I could think of is that you could send a list request with search parameters for your file, like title="File_1.xml" and fileExtension="xml". It will either return an empty list of files (there isn't one matching the serach criteria), or return a list with at least one file. If it's only one - it's easy. But if there are more - you'll have to select one of them based on some other fields. Remember that in gdrive you could have more than 1 file with the same name. So the more search parameters you provide, the better.

提交回复
热议问题