9

What is an effective way to determine how much free space is on the SD card?

Ian Vink
  • 66,960
  • 104
  • 341
  • 555
  • 1
    Do you want to do it programmatically? – James Black Aug 14 '10 at 02:10
  • possible duplicate of [How to Check available space on android device ? on mini sd card ?](http://stackoverflow.com/questions/3394765/how-to-check-available-space-on-android-device-on-mini-sd-card) – James Black Aug 14 '10 at 02:13

5 Answers5

5

If you just want to check it yourself, here are the steps to do it:

http://www.tech-recipes.com/rx/5641/android-how-to-check-available-internal-and-sd-card-memory-space/

UPDATE:

I just found that there is a better SO answer to this question:

How to Check available space on android device ? on SD card?

Community
  • 1
  • 1
James Black
  • 41,583
  • 10
  • 86
  • 166
0

Usable since API level 9:

Environment.getExternalStorageDirectory().getUsableSpace();

http://developer.android.com/reference/java/io/File.html#getUsableSpace()

tknell
  • 9,007
  • 3
  • 24
  • 28
0

Here are some methods to get available space, these methods give you more control and you can get available space in different units bytes, kb, mb, gb.

How to Check available space on android device ? on SD card?

Community
  • 1
  • 1
Muhammad Nabeel Arif
  • 19,140
  • 8
  • 51
  • 70
-2

Here is a function that allows you to retrieve the amount of memory in the android device. You can very easily find out the amount of memory that is left of you SD card via the phones device information. Please elaborate if your requirements are something else.

Shouvik
  • 11,350
  • 16
  • 58
  • 89
-5

Create a file and write one byte at a time until you get an out of space exception.

Aaron C
  • 3,328
  • 1
  • 24
  • 22