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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -