I've coded my game for 320x480 and I figure that the easiest way to support multiple resolutions is to scale the end image. What are your thoughts on this? Would it be cpu efficient to do it this way?
I have all my images placed in the mdpi folder, I'll have it drawn unscaled on the screen onto a buffer, then scale it to fit the screen. all the user inputs will be scaled as well.
I have these 2 questions: -How do you draw a bitmap without android automatically scaling it -How do you scale a bitmap?
I have stumbled upon the same problem a number of times in my projects and each time due to lack of time (and laziness) I would be satisfied with a less than optimum solution. But recently I found some time to crack down this particular issue. Here is my solution and I hope it helps you as well.
I am working on a game and I have targeted 1280x800 and I've made all of the images to match that resolution. The very first time I launch the game I scale all of the images down to match the current resolution and use the scaled images to actually draw the game. If you are using a SurfaceView then you shouldn't have problems with scaling images when you draw them. Just to be 100% sure I keep my images in the raw directory and load them from there.
To do the initial scaling of the bitmap you just need to use the
BitmapFactory.Options
when you decode the bitmap to tell it what density it's targeted for and what density it's actually going to be displayed on.