List of usage examples for android.os StatFs getBlockSize
@Deprecated public int getBlockSize()
From source file:Main.java
static public long getTotalInternalMemorySize(StatFs stat) { long blockSize = stat.getBlockSize(); long totalBlocks = stat.getBlockCount(); return totalBlocks * blockSize; }
From source file:Main.java
static public long getAvailableInternalMemorySize(StatFs stat) { long blockSize = stat.getBlockSize(); long availableBlocks = stat.getAvailableBlocks(); return availableBlocks * blockSize; }
From source file:Main.java
@SuppressWarnings("deprecation") private static long getSize(StatFs statFs) { int blockSize = statFs.getBlockSize(); int availableBlocks = statFs.getAvailableBlocks(); return (blockSize * availableBlocks) / (1024 * 1024); }
From source file:Main.java
public static long getPathSpace(String path) { StatFs statFs = new StatFs(path); return statFs.getBlockSize() * (long) statFs.getAvailableBlocks(); }
From source file:Main.java
public static long getSDSize() { String str = Environment.getExternalStorageDirectory().getPath(); StatFs localStatFs = new StatFs(str); long blockSize = localStatFs.getBlockSize(); return localStatFs.getAvailableBlocks() * blockSize; }
From source file:Main.java
private static long getAvailableStorage() { StatFs statFs = new StatFs(root); long blockSize = statFs.getBlockSize(); long availableBlocks = statFs.getAvailableBlocks(); long availableSize = blockSize * availableBlocks; // Formatter.formatFileSize(context, availableSize); return availableSize; }
From source file:Main.java
public static long getTotalInternalMemorySize() { File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long totalBlocks = stat.getBlockCount(); return totalBlocks * blockSize; }
From source file:Main.java
public static long getAvailableInternalMemorySize() { File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long availableBlocks = stat.getAvailableBlocks(); return availableBlocks * blockSize; }
From source file:Main.java
public static long calculateUsedDiskSpaceInBytes(String path) { StatFs statFs = new StatFs(path); long blockSizeBytes = (long) statFs.getBlockSize(); return (blockSizeBytes * ((long) statFs.getBlockCount())) - (blockSizeBytes * ((long) statFs.getAvailableBlocks())); }
From source file:Main.java
public static long getAvailableInternalRomSize() { File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long totalBlocks = stat.getBlockCount(); long availBlocks = stat.getAvailableBlocks(); return availBlocks * blockSize; }