I've heard that using a list of Bitmaps for animation is a bad idea. But I had not run into a situation to prove that was true until now.
The code I have works great. But only on the emulator, or on my phone running Android 6. Anything lower than that and I get an Out of Memory before it finishes initializing.
This is how I'm loading the images in:
public static Image[] flameIs = new Image[300];
for (int i=0;i<300;i++) {
if (i>=10) framePref="000";
if (i>=100) framePref="00";
Assets.flameIs[i] = g.newImage("frames/lighter_" + framePref +i+ ".png", ImageFormat.RGB565);
}
So it's like 300 PNGs, 8bit, about 12k each in size. We're talking about less than 4MB worth of images.
All the app does later is run these frames in a loop forever.
Is there a way to avoid that "out of memory"?