【发布时间】:2023-03-23 05:06:01
【问题描述】:
我想使用 Google Play 服务将 Google Drive 上传/下载 txt 文件到我的 Android 应用程序,但我没有找到正确的方法。
在 Dropbox 中很容易:
File file = new File("working-draft.txt");
FileInputStream inputStream = new FileInputStream(file);
Entry response = mDBApi.putFile("/magnum-opus.txt", inputStream,
file.length(), null, null);
Log.i("DbExampleLog", "The uploaded file's rev is: " + response.rev);
但是对于带有 Google Play 服务的 Google Drive,我还没有找到这样简单的方法。你知道怎么做吗?
顺便说一句,我想使用自己的凭据(谷歌服务帐户)而不是用户帐户,用 Google Play 服务实现它的方法是什么?
提前致谢
【问题讨论】:
标签: android google-drive-api google-drive-android-api