How can I programmatically check how much free space an SD card mounted on an Android device has?
Here's a simpler way, that is usable since API level 9:
Environment.getExternalStorageDirectory().getUsableSpace();
http://developer.android.com/reference/java/io/File.html#getUsableSpace()