List of usage examples for java.io File getPath
public String getPath()
From source file:Main.java
public static long getTotalInternalMemorySize() { File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = (long) stat.getBlockSize(); long totalBlocks = (long) 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 = (long) stat.getBlockSize(); long availableBlocks = (long) stat.getAvailableBlocks(); return availableBlocks * blockSize; }
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; }
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 blockSize * availableBlocks; }
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 / 1024 / 1024; }
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 / 1024 / 1024; }
From source file:Main.java
public static String readFile(File file) { return readFile(file.getPath()); }
From source file:Main.java
@SuppressWarnings("deprecation") 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 String getRomTotalSize(Context context) { File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long totalBlocks = stat.getBlockCount(); return Formatter.formatFileSize(context, blockSize * totalBlocks); }
From source file:Main.java
public static String getAvailableInternalMemorySize(Context context) { File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long availableBlocks = stat.getAvailableBlocks(); return Formatter.formatFileSize(context, availableBlocks * blockSize); }