Hi Friends,
I'm working on an app for Android with a few other people, and the primary content is specified by our designers as text files in a certain file format, which we then parse, process, and serve in the app. We're currently storing them in res/raw
.
This makes things great for the designers because when they want to add content, they simply add a file to res/raw
. This is annoying as a developer, however, since we developers then need to add R.raw.the_new_file
to an array in the code specifying which files to process at startup.
Is there a way to access the resource ID's of res/raw
programatically? Ideally when the application starts, we could make a call to see which files are in res/raw
, process all of them, so we could eliminate the small overhead with matching up the contents of res/raw
with that of our array in the code.
The most promising path I've seen is getAssets
from Resources, which would let me call list(String)
on the AssetManager, but I've had trouble getting this to work, especially since you can't directly call "res/raw"
as your filepath (or at least, it hasn't worked when I've tried.
Suggestions? Thanks ^_^