Suppose I store various images in raw folder. However, my own code first learns of the file names at runtime. (It reads a text configuration file at startup.) Is it possible to then search "raw" folder in my android app and if found, load image from raw into imageview?
Asked
Active
Viewed 6,380 times
3
-
3Why don't you just put your images in drawable folder and load it from there? – Daniel Conde Marin May 25 '13 at 01:25
-
1Well if you said asset directory, I would probably understand your end game, but like this, this is no different from putting your images in drawable folder, maybe you were looking to open your image just knowing its name, then look at this http://stackoverflow.com/questions/2349652/android-open-resource-from-drawable-string. And just in case you can find your image like this `R.raw.yourimage` – Marko Lazić May 25 '13 at 01:39
-
@Mario: Are you loading your images using "R.raw.yourimage" because that is what I need to do, i.e. with "". (I want to store text files, images etc. custom for each client, i.e. skinning. I am replacing the folder before compiling with clients images, config files reading during start etc.) – Tom May 25 '13 at 05:18
-
@Mario That said, I guess I will be using res/raw for storing my configuration files, and then assets for images for which I can't use the "R.xxx" resource constants for. (Still new to Android, so the difference was not immediately apparent to me) – Tom May 25 '13 at 06:14