android 获得存储设备状态

1.获取存储器总大小,可用大小

File path= Environment.getExternalStorageDirectory();
StatFs fs = new StatFs(path.getPath());
long blockcount = fs.getBlockCountLong();
long availblockcount = fs.getAvailableBlocksLong();
long blocksize = fs.getBlockSizeLong();

android 获得存储设备状态

上一篇:截取指定长度字节数后的字符串(Java方法实例,注:同样思路js也适用)


下一篇:添加、移除、移动、复制、创建、查找节点