Android examples for Phone:Storage
get Internal Storage Free Space
//package com.java2s; import android.os.Environment; import android.os.StatFs; public class Main { public static final int getInternalFreeSpace() { final String path = Environment.getDataDirectory() .getAbsolutePath();/* w w w. j av a2 s. c o m*/ final int mbytes = getSpaceForFile(path); return mbytes; } private static final int getSpaceForFile(String path) { final StatFs sf = new StatFs(path); final int blocks = sf.getAvailableBlocks(); final int blockSize = sf.getBlockSize(); final int totalBytes = blocks * blockSize; return totalBytes; } }