title: Android file writing Read-Only file system warning
body: <p>I'm trying to write a file using the <code>FileOutputStream</code>and <code>OutputStreamWriter</code>but I keep getting a read only warning.</p>
  
  <p>Here is the code that I am using</p>
  
  <pre><code>FileOutputStream fw = new FileOutputStream((trackName.replaceAll(" ", ""))+".gpx", true);
      OutputStreamWriter osw = new OutputStreamWriter(fw);
      osw.write(XML_HEADER+"\n");
      osw.write(TAG_GPX+"\n");
  
  
      writeTrackPoints(trackName, osw, locations, time, trackDescp);
      writeWayPoints(osw, locations,time);
      osw.flush();
      osw.close();
  </code></pre>
  
  <p>And the <code>Logcat</code>output is</p>
  
  <pre><code>java.io.FileNotFoundException: /test.gpx (Read-only file system)
  at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
  at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)
  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:97)
  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:168)
  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:147)
  at com.fyp.run_race.GPXFileWriter.&lt;init&gt;(GPXFileWriter.java:25)
  at com.fyp.run_race.GPSTrackDetails$1.onClick(GPSTrackDetails.java:58)
  at android.view.View.performClick(View.java:2408)
  at android.view.View$PerformClick.run(View.java:8816)
  at android.os.Handler.handleCallback(Handler.java:587)
  at android.os.Handler.dispatchMessage(Handler.java:92)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4627)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>I ament sure what the problem is really.</p>