/**
* 判断内存卡的可用空间
*
* @param sizeMb
* @return
*/
public boolean isAvaiableSpace(int sizeMb) {
String sdcard = Environment.getExternalStorageDirectory().getPath();
File file = new File(sdcard);
StatFs statFs = new StatFs(file.getPath());
int availableSpare = (int) (statFs.getBlockSize() *
((long) statFs.getAvailableBlocks() - 4)) / (1024 * 1024);//内存卡的可用空间(MB)
if (sizeMb > availableSpare) {
return false;
} else
return true;
}