@Andres_Cotes btw. the file extension https://puravidaapps.com/file.php already offers some blocks, which offer this functionality...
Return a list of available storage directories.
Return available size of given storage directory in Bytes.
To get the value in KB, divide by 1024. To get the value in MB, divide by another 1024. To get the value in GB, divide by another 1024.
Minimum API Level for this method is API Level 9 (Android 2.3)