Reputation: 31
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:
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:
Upvotes: 3
Views: 904
Reputation: 28911
I think this page should help: http://developer.android.com/guide/practices/screens_support.html
1.5 doesn't do scaling because all devices at the time of 1.5 launch were mdpi.
For 1.6 and above Android decides which res directory to pull from based on a runtime determination of the screen's dpi and then scales assets appropriately.
So if you put your 100x100 bitmap in res/drawable and then run your app on an hdpi device, Android will first look for the bitmap in res/drawable-hdpi, when it doesn't find it Android will scale up the resource you have in res/drawable.
Upvotes: 1