title: Saving to device with no SD card
body: <p>My friend and I are attempting to create an app that saves files to a device. We used this code to write to an external SD card, and it works great on his Droid X and Samsung Galaxy Tab. </p>
  
  <p>Get the path to the SD card:</p>
  
  <pre><code>private static final File ROOT = Environment.getExternalStorageDirectory();
  </code></pre>
  
  <p>Create the folder path and files:</p>
  
  <pre><code>FileWriter fw = new FileWriter(ROOT + "/test/" + "time_frames.txt");
  </code></pre>
  
  <p>we are using document factory to create the documents</p>
  
  <p>so you can see that we create the path then try to save to that path that was just created</p>
  
  <pre><code>File file = new File(ROOT + "/test/" + "time_frames.txt");
  </code></pre>
  
  <p>When I run it on my Nexus S (which does NOT have a SD card) is having trouble with the exact same code.</p>
  
  <pre><code>private static final File ROOTtest = Environment.getExternalStorageDirectory();
  </code></pre>
  
  <p>this returns /data</p>
  
  <pre><code>private static final File ROOT = Environment.getRootDirectory();
  </code></pre>
  
  <p>this returns /mnt/sdcard</p>
  
  <pre><code>private static final File intData = Environment.getDataDirectory();
  </code></pre>
  
  <p>this returns /system</p>
  
  <p>my question is which one of these will work for devices that have SD cards and no SD cards? I have tried a lot, but trying all this stuff has really confused me. Thanks in advance</p>