title: Android Java -- Deserializing a file on the Android platform
body: <p>I have a jave program that serializes files that are stored and read later. So I take the serialized files and try to read them in on my Android phone (working in Eclipse) using the exact same code I used in Java SE:</p>
  
  <pre><code>
  FileInputStream fis = null;
  try {
      fis = new FileInputStream("iwastedahalfhouronthis.ser");
     } catch (FileNotFoundException ex) {
  }
  </code></pre>
  
  <p>FileNotFoundException thrown. So ok, its probably not in the right place. So I place the file in every possible folder within the Eclipse project and try loading from those locations. No luck. Make sure the file name is correct, no luck. Use the fully qualified name given by eclipse: "/pleasehelp/src/com/imlosingit/iwastedahalfhouronthis.ser". No luck. Passed a file object into the FileInputStream. No luck. This was so trivially easy on Java. What's going on here?</p>
  
  <p>-----------EDIT SOLUTION--------------------</p>
  
  <pre><code>
          Data data = null; //object to be deserialized
          InputStream is = null;
          ObjectInputStream ois=null;
          AssetManager assets = getAssets();
          is = assets.open("fff.ser");
          ois = new ObjectInputStream(is);
          data = (com.data.Data) ois.readObject();
  </code></pre>