title: Environment.getExternalStorageState() returns MEDIA_REMOVED on an HTC that has available memory
body: <p>In my app, im trying to check whether the user has connected their phone to the pc as a drive, so I can warn them to disconnect it because I need access to the storage.</p>
  
  <p>It works fine on all 4-5 devices that I've tested on, except this <strong>HTC Desire X phone, Android 4.0.4</strong> . It has no SD card, but there is about 2 gb of some storage available for writing.</p>
  
  <p>Here is the code that I use</p>
  
  <pre><code>private void checkStorage() {
      // Get the external storage's state
      String state = Environment.getExternalStorageState();
      Log.d("STATE", state);
      if (state.equals(Environment.MEDIA_MOUNTED)) {
          // Storage is available and writeable
          externalStorageAvailable = externalStorageWriteable = true;
      } else if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
          // Storage is only readable
          externalStorageAvailable = true;
          externalStorageWriteable = false;
      } else {
          // Storage is neither readable nor writeable
          externalStorageAvailable = externalStorageWriteable = false;
      }
  }
  </code></pre>
  
  <p>So when I run it, the logcat debug tag returns:</p>
  
  <pre><code>removed
  </code></pre>
  
  <p>According to documentation:</p>
  
  <pre><code>http://developer.android.com/reference/android/os/Environment.html#MEDIA_REMOVED
  
  "Storage state if the media is not present."
  </code></pre>
  
  <p>How can I modify this code so it detects the presence of a memory that is available for use? </p>
  
  <p>Now, there is another thing. On this phone, when I try downloading an image from the browser, Im not allowed to, and I get the following message:</p>
  
  <pre><code>No SD card
  An SD card is required to download &lt;filename&gt;
  OK
  </code></pre>
  
  <p>Is there something wrong with the phone or is this normal? How do I make my app work on this phone?</p>
  
  <p>EDIT: Furthermore, if I am able to get past this, how do I write files to the storage? Here's my code that does that and works on other devices:</p>
  
  <pre><code>File directory = null;
      File file = null;
  
      try {
          directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), 
                  Utils.getWritableDiectory(Locale.ENGLISH));
  
          if (!directory.exists()) {
              directory.mkdirs();
          }
  
              file = new File(directory, "data.json");
  </code></pre>