I'm confused about how to write resolution independent code for an Android game and I'm looking for some concise tips and guidelines as I'm never sure what to do about the multiple versions of Android. Here's what I specifically want to do:
- I want to load a 100x100 pixel .png file into a Bitmap object.
- When the bitmap it loaded, I want it scaled so that when I draw it to the canvas it covers the width of the screen.
- I want my app to run on API 1.5 (as 15% of people still use this http://developer.android.com/resources/dashboard/platform-versions.html) and above.
Can someone explain what I would do in the above situation to get the results I want?
The things I'm specifically confused about are:
- How does API1.6 pick which folder (e.g. -hdpi) to load a bitmap from and how does it decide what to scale it by?
- Does API 1.5 have some kind of auto scaling feature? The width and height reported by the canvas seems to be scaled by the screen density.