本文介绍了有可能在同一个项目中使用谷歌驱动器REST API和Android API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 我有一个使用谷歌驱动器android API构建的项目,但是我想分享一个上传到我的云的文件,并且我在这里读到另一个问题,那就是使用REST API。所以我问你,有两种方法可以在同一个项目中使用这两个API? 谢谢 解决方案是的,这是可能的。只需查看这个云端硬盘文件的生命周期,就可以想象您的应用在该图片上(Android应用程序)和底部的 REST Api (Drive Service)。不过,有几点需要注意: / GDAA的主标识符DriveId只存在于GDAA(GooPlaySvcs)中,并且不存在于REST API。您必须检索ResourceId,它是REST Api中的主要标识符(请参阅 /文件夹(请参阅 SO 22874657 ) 3您会遇到很多计时问题,这些问题是由于GDAA在自己的时间表上缓冲了网络请求(系统优化),而REST API让你的应用程序控制等待响应。一般来说,如果您扫描这些 SO问题,您会发现很多关于这些问题的喋喋不休问题(尽管如此)。 我为 GDAA 和 REST API,可以帮助你,如果你合并他们(两者中的MainActivity几乎相同,CRUD方法具有相同的签名)。 好运 I have a project that was build using the google drive android API, but i want to share a file uploaded to my cloud, and I read in another question here that this is just possible using the REST API. So I ask you, there is a way to work with the both API's in the same project?thanks 解决方案 Yes, it is possible. Just looking at the this 'Lifecycle of a Drive file', you can imagine your app on top of that picture (Android App) and the REST Api on the bottom (Drive Service). There is a few points to keep in mind, though:1/ The GDAA's main identifier, the DriveId lives in GDAA (GooPlaySvcs) only and does not exist in the REST Api. You must retrieve 'ResourceId' which is the main identifier in the REST Api (see SO 29030110).2/ ResourceId can be obtained from the DriveId only after GDAA committed (uploaded) the file/folder (see SO 22874657)3/ You will run into a lot of timing issues caused by the fact that GDAA 'buffers' network requests on it's own schedule (system optimized), whereas the REST Api let your app control the waiting for the response. In general, if you scan these SO questions, you'll find a lot of chatter about these issues (it's a mess, though).I maintain a minimal CRUD wrappers for both GDAA and the REST api that can help you if you merge them (the MainActivity in both of them is almost identical and the CRUD methods have the same signatures).Good Luck 这篇关于有可能在同一个项目中使用谷歌驱动器REST API和Android API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-07 00:10