title: App crashes on devices with removable sd card when it is not inserted
body: <p>my application stores files received from other devices in the external storage. It works fine with devices with non removable sd cards</p>
  
  <p>The issue is on galaxy tab4 when the external sd card is not inserted. </p>
  
  <p>I am using the following line to get file path</p>
  
  <pre><code>String filePath=Environment.getExternalStorageDirectory()+"/BFT/";
  </code></pre>
  
  <blockquote>
    <p>What I want to do is if the external sd card is removable and not inserted I want to create the above mentioned directory in the device storage (Like 16 GB is provided in Galaxy s4).</p>
  </blockquote>
  
  <p>I am confused because in galaxy s4 it is working fine but it is stored in this directory when using Environment.getExternalStorageDirectory()+"/BFT/"</p>
  
  <p><a href="http://i.stack.imgur.com/r0LOj.png" rel="nofollow">This is where it is stored on S4</a></p>
  
  <p>How to make it work on tab4 or any other device which may crash when external sd card is removable and not inserted and I used the above line.</p>
  
  <blockquote>
    <p>I just want a folder to be created on the device no matter what its storage architecture is. Specific code is appreciated or at least what is causing the error(I know directory is not found.But Why?).</p>
  </blockquote>