Android examples for App:Local Storage
get Available Internal Storage
//package com.java2s; import android.os.Environment; import android.os.StatFs; import java.io.File; public class Main { public static long getAvailableInternalStorage() { File file = Environment.getDataDirectory(); if (file != null && file.exists()) { StatFs sdFs = new StatFs(file.getPath()); if (sdFs != null) { long sdBlockSize = sdFs.getBlockSize(); long sdAvailCount = sdFs.getAvailableBlocks(); return sdAvailCount * sdBlockSize; }/*from w w w . j av a 2 s.c o m*/ } return 0; } }