I am developing an android application where i need to determine the free space available on the sdcard. Can anyone give me some suggestion regarding this please.
thanks kaisar
To see what those files are, go to Settings > Storage > Internal Storage. Whatever is taking up the most storage space will appear on top, and it'll show you how much storage it's taking up. If you want to view the pictures or files, you only have to tap on them.
Something like this should work:
File sdcard = Environment.getExternalStorageDirectory();
StatFs stat = new StatFs(sdcard.getAbsolutePath());
long available = stat.getAvailableBlocks() * (long) stat.getBlockSize();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With