Android Multi-Screen Definition Definitions

OK people I want to create a layout compatible with a very large number of devices and screens. As I already found out, I found out that the most common screen resolutions are 249x320, 480x800, 600x1024, 720x1280 (and some other screens proportional to these).

Well, after reading the documentation, I found out that there are two ways to do this. Prior to Android version 3.2, I could use qualifiers for layouts such as "small, normal, large, xlarge" and combine them with "port" (portrait orientation) or "ground" (landscape orientation).

Now the second method (which seems to be the most recommended) works only for Android 3.2 and later. You must specify the smallest width for which the layout should be used, regardless of screen orientation (???).

Due to the fact that when using the second method you cannot specify the qualifier of the port or land, I prefer the first. My question is: is the first method compatible with Android 3.2 and later? Should I use the first method for Android <3.2, and the second for Android> 3.2? If so, I should create two projects or, possibly, combine these two methods (create about 10 layouts, for classifiers of general size and for certain qualifiers of minimum width). I believe this will require more resources.

Thank you and sorry for my bad language,

+5
source share
2 answers

On Android, you don't design your pixel-based layouts ... you create them based on pixel-density independent ones (dip or dp). These are device pixels that are scalable by the density of dots per inch of your device. Android has 4 common screen density screens, and you must provide drawings for each of them in the corresponding folder (res / drawable-ldpi, res / drawable-mdpi, res / drawable-hdpi, res / drawable-xhdpi).

Other ways to make your layout compatible with many devices is to use 9png stretch graphics and use XML drawings that rely on dp for their sizes.

Recommended reading for Android screen support:
http://developer.android.com/guide/practices/screens_support.html

, , dp, . 2 :
http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

, Android 3.2 +.

+1

, - : -

  • \
  • \ sw720dp

.

0

All Articles