开发者

Load and modify xml file in Android

开发者 https://www.devze.com 2023-01-16 04:19 出处:网络
I have an xml file which will be in either assets开发者_JAVA百科 or res folder which i need to modify by adding some values and then i need to convert the xml into a string to be sent as part of a soa

I have an xml file which will be in either assets开发者_JAVA百科 or res folder which i need to modify by adding some values and then i need to convert the xml into a string to be sent as part of a soap request. What would be the easiest way to achieve this?


You can't modify resource files.

If you don't need modify resources, you can put the XML file in assets folder. Then you can access it by AssetManager (returns by getResources().getAssets()). With AssetManager you can get InputStream from XML file or use XMLResourceParser. And do with it whatever you want.

0

精彩评论

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