1 /** 获取存储卡路径 */  
2
3 File sdcardDir=Environment.getExternalStorageDirectory();
4
5 /** StatFs 看文件系统空间使用情况 */
6
7 StatFs statFs=new StatFs(sdcardDir.getPath());
8
9 /** Block 的 size*/
10
11 Long blockSize=statFs.getBlockSize();
12
13 /** 总 Block 数量 */
14
15 Long totalBlocks=statFs.getBlockCount();
16
17 /** 已使用的 Block 数量 */
18
19 Long availableBlocks=statFs.getAvailableBlocks();

相关文章:

  • 2021-10-13
  • 2021-06-15
  • 2021-12-07
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
相关资源
相似解决方案