title: Using "Simple" XML Serialization to load data from res/raw on Android
body: <p>I am new to Java and Android development, so please keep this in mind.  My goal is to deserialize data from xml files packaged into my application.  I'm attempting to do this using Simple 2.4 but I get an "Unhandled Exception type exception" error in the code when using .read or .write</p>
  
  <p>My code looks something like this:</p>
  
  <pre><code>import java.io.InputStream;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  
  import org.simpleframework.xml.Serializer;
  import org.simpleframework.xml.core.Persister;
  
  public class ftRoster extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          //Load in all available ship files here
      }
  
      public void myClickHandler(View view)
      {
  
       InputStream iStream = getResources().openRawResource(R.raw.ship);
       Serializer serializer = new Persister();
       ShipSystem newSystem = serializer.read(ShipSystem.class, iStream);
  
   }
  }
  </code></pre>
  
  <p>And my class looks like this:</p>
  
  <pre><code>import org.simpleframework.xml.Element;
  import org.simpleframework.xml.Root;
  
  @Root
  public class ShipSystem
  {
   @Element
   public String id = null;
  
   @Element
   public boolean destroyed = false;
  
   @Element
   public int systemValue = 0;
  
  }
  </code></pre>
  
  <p>If I put a try / catch around it, of course the error goes away, but then the deserilization never occurs as well.  There is little discussion on Simple and the documentation makes it look as simple as C# serialization.  Any help would be appreciated on the problem.</p>
  
  <p>A global view of what I'm wanting to do is have an xml file for each "shipSystem" and at the boot of application deserialize each one into it's own class instance and have all of these available in an array for lookup.</p>
  
  <p>Thanks for taking the time to read and think about this.</p>