What's the best way to store and access XML in Android?

android, assets, resources, xml

Solution

I would go with adding the XML resource inside the `res` folder with the specific resource type. Its a convention that I have adapted to, having all my files in the same directory for organization.

If you add your XML file inside of `res/xml` it can be accessed anytime at run-time via `Resources.getXML()`

Problem

While I realize resources themselves are defined in XML files, if I have an XML file of my own type that I wish to use, should I be storing them in "res/xml"? Is there a better way to do this such as using assets and then loading them as binary to be parsed by another XML library?

Original source