I have about 650 small icons I need to reference in my android project. The total size of all of them is about 70 k/b’s, so size isn’t an issue.
The app I’m building simply lists all 650 of these icons along with a label for each. The labels are stored in a String array, and each of these icons has the labels index in it’s file name for easy reference (so index 0 in the labels array co-ordinates with file p0.png in the drawable folder of my android project).
This works fine, but the problem is that I can reference these images without using the R.class. The R class sets up the variables and everything, but it’s messy as hell to reference the the images through the R class when I can just loop through them and use their files names as indexes.
Is there a way to access these images without using the R.class? I’d also like to avoid using the SD card for this, as these images will be quite annoying to see in the SD card.
Suggestions?
Put the icons into the
/assetsdirectory and useAssetManagerto access them. Resources in theassetsdirectory won’t be indexed in the R file.