I am building an Android app that loads a string array from and XML file in the resources folder using:
getResources().getStringArray(R.array.arrayname);
My XML looks something like this
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<array name = "HSNames">
<item>My String</item>
<item>Another String</item>
</array>
</resources>
I want to be able to dynamically update the array by downloading a new XML file from the internet (Done).
My question is, once I've saved the XML String array to
data/data/package/myarray.xml
how do I load the array into memory? I've already scoured Stack Overflow and Google with no luck. Do I have to parse the file manually using SAXParser or is there any other easier method? The path for my file would be:
getFilesDir()+"/myarray.xml"
Specifics would be awesome! :D Thanks.