How to load an xml file from android's assets folder by name -
i trying load xml file located in /assets folder of android project name using method:
getassets().openxmlresourceparser("thefilename.xml");
however, executing code throws "filenotfound" exception, though file located in /assets folder , correct file name. now, have not put file in /res/xml folder because need able 1. edit file right on device , importantly 2. add new xml files application without issuing update, allow easy user modifications. in advance.
i think looking either getassets().open("thefilename.xml")
or getassets().openfd("thefilename.xml")
depending on end use of file is. can see dianne's response in post awhile openxmlresourceparser()
not usable gain access files in assets/ directory: http://goo.gl/2kfgt
from there have stream feed saxparser or whatever else choose.
side note: on points mentioned can't edit files directly in assets/ or add new files assets/ @ runtime. need work files on either internal or external storage things. knew that, thought i'd mention it.
hope helps!
Comments
Post a Comment