有了Phonegap,我如何检查剩余多少可用磁盘空间? [英] With Phonegap, how can I check how much free disk space remaining?

查看:134
本文介绍了有了Phonegap,我如何检查剩余多少可用磁盘空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Phonegap应用程序使用文件系统API来保存文件在设备文件系统。

I have a Phonegap app that uses filesystem API to save file on device filesystem.

启动时,应用程序需要一些文件系统空间与 .requestFileSystem 但运行时可以下载其他文件,我无法预测所需的磁盘空间总量。

On startup the app requires some filesystem space with window.requestFileSystem but runtime it's possible to download other files and I can't predict the total amount of needed disk space.

在下载开始之前检查可用空间,如果空间不够,则会向用户触发一条消息。

The idea is to check the space available before download begins and if the space is not enough then trigger a message to user.

Phonegap是否有一些方法来检查剩余的可用空间? p>

Is there some method with Phonegap to check remaining free space?

推荐答案

Phonegap不提供此功能。解决方案是创建一个phonegap插件来检查可用的空间。

Phonegap does not provide this feature. The solution is to create yourself a phonegap plugin to check the space available.

  • Phonegap plugin development guide
  • android implementation
  • iOS implementation

这篇关于有了Phonegap,我如何检查剩余多少可用磁盘空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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