I'm developing my first Connect IQ app and looking for some guidance on handling a large number of images efficiently.
The app is designed to display a sequence of SVG images — potentially up to around 600 in total (each ranging from 2KB to 20KB). Currently, I'm listing all the images in drawables.xml and assigning the Rex.Drawable.ImageIds to arrays that users can scroll through.
Here's the relevant snippet for how I'm currently displaying each frame:
bmpId = frames[_frameIndex];
_curImage = null;
_curImage = WatchUi.loadResource(bmpId);
dc.drawBitmap(0, 0, _curImage);
I've tested the app successfully with 60 images so far, but before I scale up, I have a few questions:
-
Are all images loaded into memory at app start, or are they loaded on demand?
-
Is it technically feasible to include around 600 images in a Connect IQ app?
-
Are there best practices or optimizations I should consider to handle this more efficiently?
Any insights or suggestions would be much appreciated. Thanks!