Differences between drawable-hdpi, drawable-mdpi, and drawable-ldpi:
In Versions later than android2.1, there are three directories: drawable-mdpi, drawable-ldpi, and drawable-hdpi. These three directories are mainly used to support multi-resolution.
DPI is the abbreviation of "dot Per Inch". The number of dots per inch.
Four density classifications: ldpi (low), mdpi (medium), hdpi (high), and xhdpi (extra high)
Normal screen: ldpi is 120, mdpi is 160, hdpi is 240, and xhdpi is 320.
Differences between WVGA, hvga, and qvga
VGA is the "video graphics array", and the display standard is 640*480.
WVGA (wide VGA) Resolution is 480*800
Hvga (half VGA) means half of VGA resolution is 320*480
Qvga (quarter VGA) means that the non-1/4 resolution of VGA is 240*320
Drawable-(hdpi, mdpi, ldpi) and WVGA, hvga, qvga contact
Hdpi mainly contains high-resolution images, such as WVGA (480 × 800) and fwvga (480 × 854) aspect ratio:
The mdpi mainly contains medium-resolution images, such as hvga (320 × 480) aspect ratio:
Ldpi mainly uses low-resolution images, such as qvga (240x320) Aspect Ratio
The system will find the corresponding images in these folders according to the machine resolution.
To be compatible with different screens on different platforms during development, we can crop the image with a aspect ratio, make sure there is sufficient resolution, and put it in the corresponding directory.
For example, if we want to set the background of our application window, we can simply crop the corresponding image using the specifications mentioned above, and then perform the following steps:
1. Copy the background image to the corresponding drawablefolder. In this case, bg1.png is used.
2. modify main. xml and add Android: Background = "@ drawable/Bg1:
3. The layout file is as follows:
Http://schemas.android.com/apk/res/android"
Android: Orientation = "vertical"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: Background = "@ drawable/Bg1">
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
Android: text = "Hello android"/>
References:
Differences between drawable (hdpi, ldpi, mdpi) in android2.1
Http://blog.csdn.net/infsafe/archive/2010/03/29/5426562.aspx
Differences between drawable-(hdpi, mdpi, ldpi) and WVGA, hvga, and qvga in Android Development
Http://disanji.net/2011/04/25/android-development-drawable-hdpimdpildpi-wvgahvgaqvga-diff-connection/