Write a simple XML file in the SD card using XmlSerializer

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Re: Write a simple XML file in the SD card using XmlSerializ

Postby hannon565 » Mon Dec 19, 2011 12:57 am

Just wondering if this could be used to create gpx, kml or other such files or is just for xml files?
hannon565
Junior Developer
Junior Developer
 
Posts: 15
Joined: Sun Mar 20, 2011 11:40 pm

Top

Re: Write a simple XML file in the SD card using XmlSerializ

Postby suryakanta » Fri Jan 13, 2012 7:47 pm

for the exceptions you need to add the permission::"android.permission.WRITE_EXTERNAL_STORAGE"
suryakanta
Freshman
Freshman
 
Posts: 3
Joined: Fri Jan 13, 2012 7:43 pm

Re: Write a simple XML file in the SD card using XmlSerializ

Postby suryakanta » Fri Jan 13, 2012 7:49 pm

The exceptions are coming because you missed to add "android.permission.WRITE_EXTERNAL_STORAGE" in manifest file
suryakanta
Freshman
Freshman
 
Posts: 3
Joined: Fri Jan 13, 2012 7:43 pm

Re: Write a simple XML file in the SD card using XmlSerializ

Postby suryakanta » Fri Jan 13, 2012 7:50 pm

piciujupiter wrote:E/IOException( 359): exception in createNewFile() method
E/FileNotFoundException( 359): can't create FileOutputStream
E/Exception( 359): error occurred while creating xml file

why do I get this exceptions on this code?





because you missed to add "android.permission.WRITE_EXTERNAL_STORAGE" in manifest file
suryakanta
Freshman
Freshman
 
Posts: 3
Joined: Fri Jan 13, 2012 7:43 pm

Re: Write a simple XML file in the SD card using XmlSerializ

Postby nkal722 » Fri Feb 24, 2012 5:23 pm

Thanks for the tutorial.

Can you please explain how you would add a child of a child?

<child1>
<child1-1></child1-1>
</child1>

Thanks!
nkal722
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Feb 24, 2012 5:19 pm

Re: Write a simple XML file in the SD card using XmlSerializ

Postby ejvs » Tue Mar 20, 2012 12:54 am

After we closed the file how could we add more data to it?

I'm needing add data to an existing xml file that contain already some data but if I use startDocument whith a XmlSerializer what is in the file desapear?
ejvs
Freshman
Freshman
 
Posts: 2
Joined: Mon Mar 19, 2012 8:07 pm

Top
Previous

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests