I have an application where at one stage, I need to download the latest xml file from a server and store it in internal storage (data/data/packagename/filename.xml). I've searched online and its not possible to save file at runtime to res folder, so I have to use internal storage.
However, I'm struggling to try and parse the xml file. Previously I've been using the XmlResourceParser to parse static xml already stored in res/xml/ folder. It's very easy to开发者_运维知识库 use. So I'm wondering if theres a way to use XmlResourceParser to parse the newly downloaded xml file. Otherwise, how should I parse the xml file?
Thanks.
XmlResourceParser
is for binary xml files in res
folder only. But you can use XmlPullParser. It can read data from an InputStream
.
精彩评论