Java tutorial
//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 final StatFs mStatFs = new StatFs(Environment.getDataDirectory().getPath()); public static long getTotalInternalMemorySize() { File path = Environment.getDataDirectory(); mStatFs.restat(path.getPath()); long blockSize = mStatFs.getBlockSize(); long totalBlocks = mStatFs.getBlockCount(); return totalBlocks * blockSize; } }