1

I am Using Android Studio, I want to find the actual size of Sd card external storage at my phone by code.I have used Environment.getExternalStorageDirectory option but it return 1.7 GB but mine is 8 GB. My Code:

StatFs statFs2 = new Stats(Environment.getExternalStorageDirectory().getAbsolutePath());
long blockSize2 = statFs2.getBlockSize();
final long totalSize2 = statFs2.getBlockCount() * blockSize2;
final long availableSize2 = statFs2.getAvailableBlocks() * blockSize2;
final long freeSize2 = statFs2.getFreeBlocks() * blockSize;

Please Help! Thanks.

blamb
  • 4,220
  • 4
  • 32
  • 50
Fascinator
  • 11
  • 2
  • 1
    Possible duplicate of [Android get free size of internal/external memory](http://stackoverflow.com/questions/8133417/android-get-free-size-of-internal-external-memory) – Jim Nov 06 '15 at 04:06
  • I got that thanks any way. – Fascinator Nov 06 '15 at 05:17

0 Answers0