I am building an app that moves up to 12 images on screen, and responds to touch events. Using the sample code I found on the web, it seems to work great.
I have a problem, though - I am writing something similar, but it requires adding 3D - meaning emulating the objects moving in the Z axis, too (in/out of screen).
To do this, I need to resize the images as they move.
To test this, I changed the following line in the onDraw (Panel) code:
canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);
Bitmap bmpScaled = Bitmap.createScaledBitmap(bitmap, 112, 112, false);
canvas.drawBitmap(bmpScaled, coords.getX(), coords.getY(), null);
Which works, BUT - movement on screen, plus response to touch events becomes real Jiggly.
Checking the log I see that every call to createScaledBitmap causes garbage collection of around 90mS, which causes the total app to respond jiggly.
Tried preparing 20 sized bitmaps beforehand, but since that moves the calls to those createScaledBitmap to the beginning of the app - it takes forever to load...
Can you think of any workaround or other way to achieve the scaling effect ?