Reputation: 28359
Sorry, this seems like such an obvious question, but I just can't find an answer in the docs...
I have my own XML doc (not Android related) that I need to pull and parse at run time.
Where do I store it and what's the best way to retrieve it? Do I just read it as a text document into an XML parser? Or does Android come prepared to hand me back a parsed XML object from a well formed xml?
TIA
Upvotes: 0
Views: 491
Reputation: 33996
Best way is to put your xml in assets folder and read xml from assets.
Upvotes: 2
Reputation: 24235
You can put it in assets folder of your project.
For parsing you can use openXmlResourceParser(filename)
method of AssetsManager
class
XmlResourceParser parser = getResources().getAssets().openXmlResourceParser (String fileName);
Upvotes: 3