开发者

Android Screen Density Compatibility on 1.5

开发者 https://www.devze.com 2023-01-04 09:00 出处:网络
I\'m getting ready to release my first application the marketplace. It\'s being written for devices running Android 1.5 and above, however there aren\'t any specific folders for the three different sc

I'm getting ready to release my first application the marketplace. It's being written for devices running Android 1.5 and above, however there aren't any specific folders for the three different screen densities (I think those came around in 1开发者_如何学运维.6). Should I make these folders myself? Where should I put image resources for the different densities and what should I put in my Manifest??


You will actually want to set your application up to target Android 1.6 in order to get the folders with different drawable levels, but then set the minSdkVersion="3" in the XML and rename the drawable-mdpi folder to just drawable. It will give you a warning about version mismatch but this is how supporting 1.5 but getting the nice features of 1.6 is done in Replica Island for example, which was made by a Google developer advocate. One thing to keep in mind is that by targeting 1.6 instead of 1.5, you can add targetSdkVersion="4", so that it will not force all screens to emulate 320 width, but then you will need to be far more aware of how the app will actually look and test it more thoroughly.

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4" />

For more information, read http://developer.android.com/guide/practices/screens_support.html, especially about halfway through where it mentions the XML settings.


There are a number of bugs in the system that need to be worked around as well.

The best strategy I've found to use is:

res
    drawable
    drawable-hdpi-v4
    drawable-ldpi-v4
    layout
    layout-hdpi-v4
    layout-ldpi-v4
0

精彩评论

暂无评论...
验证码 换一张
取 消