[fixed] where to put xml file?

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

[fixed] where to put xml file?

Postby kaasinees » Sun Jan 31, 2010 3:58 pm

I have an xml file which serves as a "database".
the content is like the folowing:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<units>
   <category text="length">
      <unit text="metre" ratio="1" />
      <unit text="mile" ratio="0.0006213711922373339" />
   </category>
   <category text="area">
   </category>
</units>


I have put this xml file in the src folder in my package.

I access the file like this:

Code: Select all
doc = db.parse(new File("units.xml"));


However the compiler gives me an error in the xml file.

Code: Select all
ERROR Invalid start tag units   units.xml   /univerter/src/com/shinyu/univerter   line 2   Android AAPT Problem


I think the compiler is trying to interpret it is a resource file?
Where can i correctly put my file?
Last edited by kaasinees on Sun Jan 31, 2010 11:14 pm, edited 1 time in total.
kaasinees
Freshman
Freshman
 
Posts: 2
Joined: Sun Jan 31, 2010 3:52 pm
Location: Netherlands

Top

Postby kaasinees » Sun Jan 31, 2010 11:13 pm

i fixed it by simply putting it in assets folder and using the AssetManager class..

thanks anyway
kaasinees
Freshman
Freshman
 
Posts: 2
Joined: Sun Jan 31, 2010 3:52 pm
Location: Netherlands

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests