驱动API为Android无法访问由相同的应用程序创建的文件 [英] Drive API for Android unable to access the file created by same App

查看:178
本文介绍了驱动API为Android无法访问由相同的应用程序创建的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个应用程序,其中一个用户将写入文件,通过这个程序,并使用链接的其他用户共享。其他用户将使用相同​​的手机应用程序读取该文件。我使用的车程,API为Android的使用离线书写和增量更新功能,使读者能够下载文件只有一部分是新添加或更新,而不是完整的文件下载每次。

I am writing an app where one user will write a file through this app and share it with other users using a link. Other users will read the file using same mobile app. I am using 'Drive API for Android' to use the offline writing and incremental updates feature so that readers will be able to download only that part of file which is newly added or updated instead of full file download every time.

不过遗憾的是这个应用程序由一个用户创建的文件/文件夹不是通过其他设备相同的应用程序访问。我使用的文件夹ID的方法Drive.DriveApi.fetchDriveId并得到以下错误消息。

But unfortunately the file/folder created by this app by one user is not accessible through the same app on other devices. I am using method Drive.DriveApi.fetchDriveId with the folder id and getting following error message.

驱动器没有找到,或者您无权访问它。

"Drive item not found, or you are not authorized to access it."

文件/文件夹是与相同的id相同的设备上访问,但在其他装置,这表明错误消息的第二部分是真正的原因不能访问。

File/folder is accessible on same device with same id, but not accessible on other device, which indicates that second part of error message is the real reason.

在当前范围(Drive.SCOPE_FILE),我希望,因为它是由相同的应用程序创建的文件将是可访问的,但它不工作。

With the current scope (Drive.SCOPE_FILE), I was hoping that file will be accessible as it is created by the same app, but it is not working.

所以我的问题是谷歌是否驱动器存储设备的信息,同时也创建文件/文件夹,不允许在不同设备上相同的应用程序使用它?如果没有,那一定是我在执行,我可以进一步调试错误。

So my question is "does Google Drive store device information also while creating files/folders and doesn't allow the same app on different devices to use it?" If not, it must be my mistake in the implementation, which I can debug further.

推荐答案

假设这是驱动器的API为Android的限制,我切换到驱动器REST API。我发现我一直在寻找的驱动器REST API,即增量更新的文件,断点续传下载的功能。只是,我需要管理的一些事情我自己。

Assuming this as a limitation of Drive API for Android, I am switching to Drive REST API. I found the functionality I was looking for in the Drive REST API i.e. incremental updates to the file and resumable downloads. Just that I need to manage some of the things on my own.

在这种方式中,Drive REST API是完整的,它可以提供所有的功能,而Android的驱动API与很大的局限性限制。由于没有回答我的问题,我假设它是不可能使用驱动API为Android通过谷歌云端硬盘与其他用户共享文件。

In that way, Drive REST API is complete and it can provide all the functionalities whereas Drive API for Android is constrained with lot of limitations. With no answers to my questions, I am assuming that it is not possible to share files with other users through Google Drive using Drive API for Android.

这篇关于驱动API为Android无法访问由相同的应用程序创建的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆