开发者

Using XmlResourceParser to parse xml file in internal storage

开发者 https://www.devze.com 2023-03-30 04:05 出处:网络
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

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

精彩评论

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