如何找到留在Android的免费存储(磁盘空间)是多少?磁盘空间、Android

2023-09-05 10:12:25 作者:笑尽往事

我试图找出在Android手机上运行我的应用程序的可用磁盘空间。有没有一种方法以编程方式做到这一点?

I am trying to figure out the available disk space on the Android phone running my application. Is there a way to do this programmatically?

谢谢

推荐答案

尝试StatFs.getAvailableBlocks.你需要的块数转换为KB与getBlockSize。

Try StatFs.getAvailableBlocks. You'll need to convert the block count to KB with getBlockSize.