Android examples for Hardware:Memory
get Total External Memory Size
//package com.java2s; import android.os.Environment; import android.os.StatFs; import java.io.File; public class Main { public static long getTotalExternalMemorySize() { File path = Environment.getExternalStorageDirectory(); Environment.getExternalStorageState(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long totalBlocks = stat.getBlockCount(); return totalBlocks * blockSize; }/*from w w w .j av a 2 s .c o m*/ }