Android uses two attributes to classify the screen of a device: size and density. You should imagine the device screen size and density range for installing your app. For example, you should include some optional resources to optimize the display appearance of your applications on screens of different sizes and density. 1. four general dimensions: small, normal, large, xlarge 2. four General density types: low (ldpi), medium (mdpi), high (hdpi), and extra high (xhdpi) for different screen la S and bitmaps, you must put it in a separate directory, similar to multi-language support. Pay attention to the changes to the screen size caused by the screen direction (horizontal or vertical screen). Therefore, many applications need to modify the layout to optimize the user experience in each direction. To optimize the user experience on different screen sizes when creating different la S, you should provide a unique layout XML file for each screen size idea to be supported. Each layout file should be saved in its corresponding resource directory. The directory name should use _ <screen_size> as the suffix. For example, the unique layout for the large screen should be saved in the res/layout_large/directory. Note: To properly fill the screen, Android automatically scales your layout. In this way, the layout of different screen sizes does not have to worry about the absolute size of the UI elements, but focuses on the layout structure that affects user experience (for example, the size or position of an important View is relative to that of a sibling View) for example, a project that contains the default layout and an optional layout for the large screen: MyProject/res/layout/main. xml layout-large/main. the xml layout file names must be identical, but their content is different to provide the UI corresponding to the screen size. As usual, simply layout the file in your application: @ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. main);} the Android system loads the corresponding layout File Based on the screen size of the device that runs your application. For more information, see the "Providing Resources" guide. The following example shows an optional layout for the horizontal screen: MyProject/res/layout/main. xml layout-land/main. xml default layout/main. xml is used for vertical layout. If you want to provide a special layout for the portrait and apply it to the large screen, you need to use the large and land modifiers: MyProject/res/layout/# default (portrait) main. xml layout-land/# landscape main. xml layout-large/# large (portrait) main. xml layout-large-land/# large landscape main. xml Note: Android3.2 and later support an advanced method for defining screen sizes, which allows you to specify resources for screen sizes Based on the width and height in density-independent pixel terms. This lesson does not contain this new technology. for more information, see: Designing for Multiple Screens. to create different bitmaps, you should always provide the right bitmap resources for each General density: low, medium, high, and extra-high. This helps achieve good image quality and performance in all screen density. To generate these images, you should use the original resources in vector format and generate images of each density according to the following scaling ratio: 1. xhdpi: 2.0 2. hdpi: 1.5 3. mdpi: 1.0 (baseline) 4. ldpi: 0.5 this means that if you want to generate a 150x150 image for the xhdpi device, the same resource will also generate the following images: x for hdpi; 100x100 for mdpi; 75x75 for ldpi. then they are placed in the corresponding directory of the plotting Resource: myProject/res/drawable-xhdpi/export drawable-hdpi/awesomeimage.png drawable-mdpi/export drawable-ldpi/export whenever the @ drawable/awesomeimage resource is referenced, the system will be based on the screen Density Select the corresponding bitmap.