Load and modify xml file in Android
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.
精彩评论