Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid XML serialization
    primarykey
    data
    text
    <p>I am trying to Serialize an object in my application by using the Simple Xml Serialization.(<a href="http://simple.sourceforge.net/home.php" rel="nofollow">http://simple.sourceforge.net/home.php</a>). I am trying to serialize my person class but when I run it on my device I cannot find the xml file I have created. Please see my code below:</p> <p>Person Class:</p> <pre><code>public class Person { public Person() { } public Person(String inFirstName, String inLastName) { SetFirstname(inFirstName); SetLastname(inLastName); } private String FirstName; public String GetFirstName() { return FirstName; } public void SetFirstname(String inFirstName) { FirstName = inFirstName; } private String LastName; public String GetLastName() { return LastName; } public void SetLastname(String inLastName) { LastName = inLastName; } @Override public boolean equals(Object inObject) { if (inObject instanceof Person) { Person inPerson = (Person) inObject; return this.FirstName.equalsIgnoreCase(inPerson.FirstName) &amp;&amp; this.LastName.equalsIgnoreCase(inPerson.LastName); } return false; } } </code></pre> <p>Main Activity:</p> <pre><code>public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Person person1 = new Person("billy", "boontay"); File xmlFile = new File(getFilesDir().getPath() + "/Person.xml"); try { Serializer serializer = new Persister(); serializer.write(person1, xmlFile); } catch (Exception e) { e.printStackTrace(); } } } </code></pre> <p>Can anyone see where I am going wrong? And before anyone suggests it I have already added the write external storage permission to my manifest.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload