title: How to store a class object into Internal Memory Storage using serializable?
body: <p>I need to store this object into the internal storage memory of the phone, and i have the  <code>&lt;uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"&gt;&lt;/uses-permission&gt;</code> set on the manifest. The object itself haves two static methods for store and reload it from the internal memory:</p>
  
  <pre><code>public class SaveState implements Serializable {
  static public List&lt;FullMagazine&gt; fms = new ArrayList&lt;FullMagazine&gt;();
  static SaveState instance=null;
  
  public static SaveState getInstance(){      
      if( instance == null )
          instance = new SaveState();     
      return instance;
  }
  
  public static void saveData(SaveState instance){
      ObjectOutput out;
      try {
          out = new ObjectOutputStream(new FileOutputStream("appSaveState.data"));        
          out.writeObject(instance);
          out.close();
      } catch (Exception e) {e.printStackTrace();}
  }
  
  public static SaveState loadData(){
      ObjectInput in;
      SaveState ss=null;
      try {
          in = new ObjectInputStream(new FileInputStream("appSaveState.data"));       
          ss=(SaveState) in.readObject();
          in.close();
      } catch (Exception e) {e.printStackTrace();}
      return ss;
  }
  }
  </code></pre>
  
  <p>I'm trying to store it and reopen it using this call in my activity:</p>
  
  <pre><code>            SaveState.fms.add(fm);
              SaveState.saveData(SaveState.getInstance());                
              SaveState sv = SaveState.loadData();
  </code></pre>
  
  <p>But it is not working, it is not storing the object, and ofcourse it is not reading the objecto, i'm getting these two exception while storing and reading the object:</p>
  
  <pre><code>    03-23 09:18:16.702: WARN/System.err(9060): java.io.FileNotFoundException: /appSaveState.data (Read-only file system)
  03-23 09:18:16.702: WARN/System.err(9060):     at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
  03-23 09:18:16.702: WARN/System.err(9060):     at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)
  03-23 09:18:16.702: WARN/System.err(9060):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:97)
  03-23 09:18:16.702: WARN/System.err(9060):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:168)
  03-23 09:18:16.702: WARN/System.err(9060):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:147)
  03-23 09:18:16.702: WARN/System.err(9060):     at com.Magazine.SaveState.saveData(SaveState.java:35)
  03-23 09:18:16.702: WARN/System.err(9060):     at com.Magazine.MainMenu$DownloadThread.run(MainMenu.java:807)
  03-23 09:18:16.709: WARN/System.err(9060): java.io.FileNotFoundException: /appSaveState.data (No such file or directory)
  03-23 09:18:16.709: WARN/System.err(9060):     at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
  03-23 09:18:16.709: WARN/System.err(9060):     at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)
  03-23 09:18:16.709: WARN/System.err(9060):     at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:82)
  03-23 09:18:16.709: WARN/System.err(9060):     at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:134)
  03-23 09:18:16.709: WARN/System.err(9060):     at com.Magazine.SaveState.loadData(SaveState.java:46)
  03-23 09:18:16.709: WARN/System.err(9060):     at com.Magazine.MainMenu$DownloadThread.run(MainMenu.java:809)
  </code></pre>
  
  <p>What's wrong in the code?</p>
  
  <p>Thanks</p>