How do I find remaining/total space on the local storage?
Can I use StatFs for this (as in - How to Check available space on android device ? on SD card?)
How do I find remaining/total space on the local storage?
Can I use StatFs for this (as in - How to Check available space on android device ? on SD card?)
Turns out you can. Ran this code which seems to return the appropriate number of bytes remaining in my internal storage. Unsure about the reliability of Environment.getDataDirectory()
public static long remainingLocalStorage()
{
StatFs stat = new StatFs(Environment.getDataDirectory().getPath());
stat.restat(Environment.getDataDirectory().getPath());
long bytesAvailable = (long)stat.getBlockSize() *(long)stat.getAvailableBlocks();
return bytesAvailable;
}