开发者

How do I get the amount of free disk space in PhoneGap?

开发者 https://www.devze.com 2023-03-24 09:47 出处:网络
I would like to store a significant amount of data on a device\'s nonvolatile storage开发者_开发知识库 in PhoneGap. How do I get the amount of available space so I can warn the user if there is not en

I would like to store a significant amount of data on a device's nonvolatile storage开发者_开发知识库 in PhoneGap. How do I get the amount of available space so I can warn the user if there is not enough?


Instead of asking for the total available space, you can pass the amount of space you need as the second argument to window.requestFileSystem (unsigned short type, unsigned long long size, FileSystemCallback successCallback, optional ErrorCallback errorCallback);. This may be more useful anyway, as the user agent may have per-application storage quotas or be able to present a permissions dialog "May this application use 10 megabytes of storage?".

0

精彩评论

暂无评论...
验证码 换一张
取 消