HUAWEI Driveの容量を調べる手順
- HUAWEI Driveに接続する
- HUAWEI Driveの情報を取得する
- 取得した情報から、容量の項目を選ぶ
HUAWEI Driveの情報を取得するサンプル
private var drive: Drive? = null
val about = drive?.about()?.get()?.setFields("*")?.execute()
容量を取得するサンプル
// ドライブ容量
val total = about.storageQuota.userCapacity
// 使用済み容量
val used = about.storageQuota.usedSpace
// ドライブ空き容量
val free = total - used
GitHub
HMS Drive Kit Demo : https://github.com/Rei2020GitHub/MyPublicProject/tree/master/DriveKitDemo
参考
- HMS:https://developer.huawei.com/consumer/jp/
- HMS Drive Kitの紹介:https://developer.huawei.com/consumer/jp/hms/huawei-drivekit
- HMS Drive Kitのドキュメント:https://developer.huawei.com/consumer/jp/doc/development/HMSCore-Guides/introduction-0000001050039630
- Huawei Developers:https://forums.developer.huawei.com/forumPortal/en/home
- Facebook Huawei Developersグループ:https://www.facebook.com/Huaweidevs/