title: Android: How to get storage of external sd-card?
body: <p>In my device I have 32GB internal memory and 64GB on SD-Card.
  I like to get the external free size with this method (based on this thread <a href="https://stackoverflow.com/questions/8133417/android-get-free-size-of-internal-external-memory">Android get free size of internal/external memory</a>):</p>
  
  <pre><code>public static long getAvailableExternalMemorySize() {
      if (externalMemoryAvailable()) {
          File path = Environment.getExternalStorageDirectory();
          StatFs stat = new StatFs(path.getPath());
          long blockSize = stat.getBlockSize();
          long availableBlocks = stat.getAvailableBlocks();
          return availableBlocks * blockSize;
  
      } else {
          return 0;
      }
  }
  </code></pre>
  
  <p>When I run this code it only shows me the free storage of internal memory.
  Why does it not shows the external SD-Card size?
  On Device Storage I have 11GB free and on external SD-Card there are 40GB free.</p>