Currenty I get the total storage size with:
public static long getTotalSize(String path) {
try {
final StatFs statFs = new StatFs(path);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
return statFs.getTotalBytes();
} else {
return statFs.getBlockCount() * statFs.getBlockSize();
}
} catch (Exception e) {
return 0;
}
}
As path
I am using Environment.getExternalStorageDirectory().getAbsolutePath()
. This results in 54,0 GB. Problem is that the device has a size of 64 GB.
How to detect the missing 10 GB?