1.
Screen size: The size of the physical screen, looking at the diagonal of the screen.
Resolution: is actually the sum of the pixels. 1280*720
DPI: Density. (the pixels shown per inch)
2.
HDPI: Put 480*800 resolution of the picture ~240dpi
ldpi:320*240 ~120dpi
mdpi:320*480 ~160dpi (referential)
xhdpi:1280*720 ~320dpi
LDPI, MDPI, hdpi, xhdpi scaling
L:m: h:x
3:4:6:8
3.
480*800: Small resolution to large resolution compatible, when filling the screen, will stretch, appear blurry phenomenon, do not fill, do not stretch.
Large resolution is compatible with small resolution, and a program crash may occur. General Cetucci hdpi (picture with 480*800 resolution), only those pictures that fill the screen are cut a set of
(1280*720) is placed in the xhdpi file. In the Android design process, in order to adapt to different phone resolutions, most of the images need to be stretched or compressed, so there can be arbitrarily adjusted
The size of a picture format ". 9.png". This image is a special image format for Android development, and the advantage is that it can be used in a simple way to make a picture of which areas can be
Stretching, which areas can not be stretched to set, but also to display the location of the area is clearly marked.
4, the screen adaptation method:
4.1. Define different layout files according to the different resolutions of the screen, as shown in:
4.2, according to different resolutions of the screen definition of different sizes, as shown:
4.3, in the code according to the size of the screen, dynamic settings layout
// Get high screen width New = =//Dynamic change of layout linearlayout production_factory = = = WINDOWSHEIGHT/2;p roduction_factory.setlayoutparams (params);
4.4 Use the attribute layout_weight to set.
(24) Basic concepts of screen adaptation