I am novice in android development.I am developing a game.It has 20 images with image names like num1,num2,num3..,num20.
For reading all these images i have done this in java
for ( int i=0 ; i<n ; i++)
{
imgarr[i] = Toolkit.getDefaultToolkit().getImage( this.getClass().getResource("images/"+(i+1)+".png"));
}
My question is how to do the same in android?
How to read all those images into bitmap array in simple for loop?
I know in android we can read an image into bitmap as fallows
img = BitmapFactory.decodeResource(getResources(), R.drawable.image_name);
Is there any way to read all those images in for loop?
Thanks.