I think the best way to solve your problem is for the images in the assets folder, which is always better if this folder is created in "../app/main/assets", in my case, I use this function below to get the images from the assets folder, fill a list with them and process them as I want:
private ArrayList<Bitmap> getImages(Context c) {
String[] _List;
String[] files = new String[0];
ArrayList<Bitmap> result = new ArrayList<Bitmap>();
// abre a pasta assets usando AssetManager
AssetManager assetManager = c.getAssets();
try {
// "myfolderimages" é uma pasta na minha pasta assetes
// aqui eu preciso inverter a ordem delas segundo o criterio "wH"
// nessa linha eu preencho uma lista com os nomes dos arquivos na pasta
_List = c.getAssets().list("myfolderimages");
files = wH.equals("S") ? _List : display.reverseList(_List);
} catch (IOException e) {
e.printStackTrace();
}
if (files != null)
for (int i = 0; i < files.length; i++) {
InputStream open = null;
try {
// nesta linha eu preencho o array com as imagens contidas na lista de nomes
open = assetManager.open("myfolderimages/" + files[i]);
Bitmap bitmap = BitmapFactory.decodeStream(open);
result.add(RotateBitmap(bitmap, 30.0f));
} catch (IOException e) {
e.printStackTrace();
} finally {
if (open != null) {
try {
open.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
// retorna o array com as imagens
return result;
}
Dai I use it like this:
// ...
List<Bitmap> images = new ArrayList<Bitmap>();
// ...
LinearLayout meuLayout = new LinearLayout(this);
images = getImages(context);
// ...
ImageView minhaImagem = new Imageview(this);
minhaImagem.setImageBitmap(images.get(10);
meulayout.addview(minhaImagem);
setcontentview(meulayout);
This is just an example, adapt it according to your need
I hope it helps