title: Understanding Simple XML Parser - New File Output - Java
body: <p>I am trying to learn how to use the Simple XML Framework as detailed in this thread : <a href="https://stackoverflow.com/questions/6166862/best-practises-for-parsing-xml">Best practices for parsing XML</a>.</p>
  
  <p>I am using the following code :</p>
  
  <pre><code>public class SimpleXMLParserActivity extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      //setContentView(R.layout.main);
  
      Serializer serializer = new Persister();
      Example example = new Example("Example message", 123);
      File result = new File("example.xml");
  
      try {
          Log.d("Start", "Starting Serializer");
          serializer.write(example, result);
      } catch (Exception e) {
          // TODO Auto-generated catch block
          Log.d("Self", "Error");
          e.printStackTrace();
      }
  }
  }
  </code></pre>
  
  <p>I am having a problem understanding the line </p>
  
  <pre><code>File result = new File("example.xml");
  </code></pre>
  
  <p>1) Does this line create a new file in my app called example.xml ? If so where is this file located.</p>
  
  <p>2) Or does this line look for an existing file called example.xml and then add to it ? If so where should the example.xml file be placed in my app bundle so that it can be found. I do notice at the moment I am getting an error message :</p>
  
  <pre><code>java.io.FileNotFoundException: /example.xml (Read-only file system)
  </code></pre>
  
  <p>Thank you.</p>