October 2018
Intermediate to advanced
464 pages
15h 17m
English
One issue consistent between internal and external storage is limited space. If you know how much space you will need ahead of time, you can call the getFreeSpace() method on the File object. (getTotalSpace() will return the total space.) Here is a simple example, using the call to getFreeSpace():
if (Environment.getExternalStorageDirectory().getFreeSpace() < RQUIRED_FILE_SPACE) {
//Not enough space
} else {
//We have enough space
}