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 long getAvailableROM() { File dataDirectory = Environment.getDataDirectory(); StatFs statFs = new StatFs(dataDirectory.getPath()); long blockSize = statFs.getBlockSize(); long blockCount = statFs.getBlockCount(); long availableBlocks = statFs.getAvailableBlocks(); return availableBlocks * blockSize; } }