开发者

Using XmlResourceParser to parse xml file in internal storage

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜