Home » Android » Android How Much space is free on the SD card?

Android How Much space is free on the SD card?

Posted by: admin June 15, 2020 Leave a comment

Questions:

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

How to&Answers:

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?

Answer:

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?

Answer:

Usable since API level 9:

Environment.getExternalStorageDirectory().getUsableSpace();

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

Answer:

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.

Answer:

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