Here you can find the source of getExternalStorageTotalSize()
public static long getExternalStorageTotalSize()
//package com.java2s; import android.os.Environment; import android.os.StatFs; public class Main { /**//from w w w.jav a 2s . c o m * Obtain SD card total size. * * @return byte unit of SD card total size. * @author Sean Zheng * @CreateDate 2013-4-23 */ public static long getExternalStorageTotalSize() { final StatFs statfs = new StatFs(Environment .getExternalStorageDirectory().getAbsolutePath()); final long blockCount = statfs.getBlockCount(); final long blockSize = statfs.getBlockSize(); return blockCount * blockSize; } }