Please help: xml append

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Please help: xml append

Postby dreamdelerium » Sat Jan 02, 2010 10:26 pm

hello everyone. I posted this yesterday and havent gotten a response:

hello everyone. im new to this forum and to android, so please be patient ;). Im trying to find a way to edit an xml file during run time. Im using an xml file as a resource to store data. i can read the file during run time but dont know how to edit (insert a node for example). if anyone could post an example or a link to a tutorial id really appreciate it.
thanks


Is it because this just can be done? am i doing something wrong? Id really appreciate any help

thanks
jason
dreamdelerium
Developer
Developer
 
Posts: 30
Joined: Fri Jan 01, 2010 11:19 pm

Top

Postby sing1e » Sun Jan 03, 2010 2:56 am

Hi, I am new to android,too.

I think you can use dom api to implement your requirement.

you can use google search to find a lot examples about dom api.
sing1e
Freshman
Freshman
 
Posts: 9
Joined: Sat Dec 12, 2009 10:55 am

thanks but...

Postby dreamdelerium » Sun Jan 03, 2010 3:43 am

thanks for the reply. ive been searching everywhere for anything and i havent seen anything about writing to an xml file thats a resource. i have seen examples of creating xml files on a sd card but nothing about editing an xml file thats a resource. if you have a link id appreciate it. thanks again!
jason
dreamdelerium
Developer
Developer
 
Posts: 30
Joined: Fri Jan 01, 2010 11:19 pm

Postby sing1e » Sun Jan 03, 2010 4:09 am

You mean that you want to modify the xml from the res folder?

I think the res folder is read only.

you are not allowed to modify the xml from res foler!
sing1e
Freshman
Freshman
 
Posts: 9
Joined: Sat Dec 12, 2009 10:55 am

Postby dreamdelerium » Sun Jan 03, 2010 7:20 am

so, whats the best way to store data in an xml file? or is it best to just use sqlite?
dreamdelerium
Developer
Developer
 
Posts: 30
Joined: Fri Jan 01, 2010 11:19 pm

Postby sing1e » Sun Jan 03, 2010 2:46 pm

I think there are two ways!

The first, sdcard.

The second, using the app private directory,and the absolute path is /data/data/your package name/
sing1e
Freshman
Freshman
 
Posts: 9
Joined: Sat Dec 12, 2009 10:55 am

Top

thanks

Postby dreamdelerium » Sun Jan 03, 2010 5:58 pm

cool. but that just brings be back to my original question. how do i edit/append an xml file :)
dreamdelerium
Developer
Developer
 
Posts: 30
Joined: Fri Jan 01, 2010 11:19 pm

Postby dreamdelerium » Mon Jan 04, 2010 4:58 pm

well, im gonna assume this just cant be done. ill start looking at sqlite
dreamdelerium
Developer
Developer
 
Posts: 30
Joined: Fri Jan 01, 2010 11:19 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 9 guests