Android Studio 使用 API 密钥从驱动器下载文件?

Android Studio download file form drive using API Key?

https://www.googleapis.com/drive/v3/files/Fileid?acknowledgeAbuse=false&alt=media&key=KEY

这个 link 在浏览器上运行良好,但在 Android Studio 中运行不正常 使用 URL 和 URLConnection.

使用 API 键入 Android Studio 下载文件形式的驱动器?

您可能需要参考 Making a Simple Request or this thread for this particular problem because what you want to do is not just open the link but instead make a web service request to the Drive API. Also, take note that REST calls need to be authorized. You may also want to refer to Download Files 文档,因为其中还有一些步骤可以帮助您提出正确的请求。