This code return total internal memory size:
public static String getTotalInternalMemorySize() {
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long totalBlocks = stat.getBlockCount();
return formatSize(totalBlocks * blockSize);
}
But this size is without system used memory.
For example, at the GALAXY NOTE 3 is the total internal memory of 32 GB, but this function returns only 26.18 GB.
How to determine the overall internal memory including missing 5.82 GB of system memory?
The basic idea that may work is to compute the first number which is power of two, and it is bigger than the number you got returned from the function.
In this case your number is 32. You should convert to integer before comparing obviously.