Here you can find the source of getRealSizeOnSdcard()
public static long getRealSizeOnSdcard()
//package com.java2s; //License from project: Apache License import java.io.File; import android.os.Environment; import android.os.StatFs; public class Main { public static long getRealSizeOnSdcard() { File path = new File(Environment.getExternalStorageDirectory() .getAbsolutePath());//from www . j a v a2s . c om StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long availableBlocks = stat.getAvailableBlocks(); return availableBlocks * blockSize; } }