I am working on a C# and Android library project. What I am basically trying to do is write a library in Android that will send me crash details onto my server.
I then have a C# console application that runs on my server and processes the data received by Android and from this data I want to generate an XML file, so that another program can read in the XML file and provide a monthly report.
I've got stuck with the best way of writing and reading the XML though.
I've read a lot about it and found various things such as XMLWriter
or XMLSerializer
but I don't know which works best, nor do I understand entirely how these are implemented.
Below is a basic design of how the XML file should be written, this is what I've written manually to give an understanding of what I want to achieve.
<?xml version="1.0" encoding="utf-8" ?>
<apps>
<app>
<MyApp>
<appID>1</appID>
<applicationID>0027598641</applicationID>
<platform>Android</platform>
<CrashDetails>
<Exceptions>
<Exception>
<CrashID>55</CrashID>
<ExceptionType>NullPointerException</ExceptionType>
<FullException>NullPointerException at line 2</FullException>
<StartDate>01-11-2013 09:52:00</StartDate>
<EndDate>02-11-2013 14:43:13</EndDate>
<AppVersionName>6.1.1.6</AppVersionName>
<stacktrace>NullPointerException at line 2 com.MyCompany.MyApp.MyClass.MyMethod</stacktrace>
<Severity>Critical</Severity>
<OccurrenceCount>9</OccurrenceCount>
</Exception>
<Exception>
<CrashID>56</CrashID>
<ExceptionType>NullPointerException</ExceptionType>
<FullException>NullPointerException at line 2</FullException>
<StartDate>01-11-2013 09:52:00</StartDate>
<EndDate>02-11-2013 14:43:13</EndDate>
<AppVersionName>6.1.1.6</AppVersionName>
<stacktrace>NullPointerException at line 2 com.MyCompany.MyApp.MyClass.MyMethod</stacktrace>
<Severity>Critical</Severity>
<OccurrenceCount>9</OccurrenceCount>
</Exception>
</Exceptions>
</CrashDetails>
</MyApp>
<MyApp1>
<appID>2</appID>
<applicationID>4844354</applicationID>
<platform>Android</platform>
<CrashDetails>
<Exceptions>
<Exception>
<CrashID>55</CrashID>
<ExceptionType>NullPointerException</ExceptionType>
<FullException>NullPointerException at line 2</FullException>
<StartDate>01-11-2013 09:52:00</StartDate>
<EndDate>02-11-2013 14:43:13</EndDate>
<AppVersionName>6.1.1.6</AppVersionName>
<stacktrace>NullPointerException at line 2 com.MyCompany.MyApp.MyClass.MyMethod</stacktrace>
<Severity>Critical</Severity>
<OccurrenceCount>9</OccurrenceCount>
</Exception>
</Exceptions>
</CrashDetails>
</MyApp1>
</app>
</apps>
Thanks for any help you can provide.