【问题标题】:Is there a way to check Google drive storage using Drive API for Android?有没有办法使用适用于 Android 的 Drive API 检查 Google 驱动器存储?
【发布时间】:2017-11-07 12:31:19
【问题描述】:
【问题讨论】:
标签:
xamarin
xamarin.forms
xamarin.android
【解决方案1】:
在某些情况下,应用程序可能需要使用 Google Drive 网络服务来访问其他功能或访问比 Google Drive Android API 中可用的范围更广的功能。
Google 不会在 Android.Gms.Drive api 中公开用户的 Drive 存储配额。
您需要使用已授权 Drive 范围和调用的 Auth2 令牌 来使用 Rest API:
通过 Json 响应,您可以访问storageQuota:
{
"storageQuota": {
"limit": "16106127360",
"usage": "3115832693",
"usageInDrive": "373280402",
"usageInDriveTrash": "46755721"
}
}
谷歌参考:About: get