"Turn" thoroughly understand Android ldpi, MDPI, hdpi, xhdpi, xxhdpi folder meaning

Source: Internet
Author: User

This question I believe that a lot of people, including many old birds, and some people think they understand is actually wrong, including before I, in doing Andro match, generally let the artist do 720*1280 transduction, directly put to xhdpi, if is done 1080* 1920, put it directly under the xxhdpi.

In fact, these four folders and the specific screen resolution is not directly related, the above-mentioned practice also has some reason, because most of the 720*1280 mobile phones are high-density mobile phones, 1080*1920 are ultra-high-density mobile phones, but these four folders and screen density, and specific resolution independent.


Here is the most critical equation:
Low:medium:high:extra-high:extra-extra-high=3:4:6:8:12

OK, which means that the ratio of five folders is 3:4:6:8:12. What exactly is going on? The following analysis:
For example, I use a 480*800 4-inch mobile phone, the cell phone's screen density according to Google's view, is the level of density (by the resolution and screen size to calculate the density, Then Google itself has a set of standards that you are located in which level of density levels, and then the application of the phone in the picture, it will go to hdpi down to find, and the folder of the picture as standard, That is to say, for example, my application to take a picture of aa.png, the image of the original size of 30*30, just hdpi under a picture, then this picture shows on the screen, its display size is 30px long and wide. That's the problem, but if my hdpi without this picture, and only under xhdpi have this picture, the original size of the picture is 30*30, then ask the screen to show the size of the picture will be how much, or the length of the width is 30px?


The answer is no, and now it's using the ratio above, high:extra-high=6:8. First clear such a problem, if my screen is hdpi, the result of my picture is put in xhdpi, the system will be the picture to reduce the display, that is, my xhdpi decentralized a 30*30 picture, that shows when the hdpi screen is certainly smaller than 30*30, This will ensure that the size of the screen interface display is consistent, because the density of the mobile phone display a picture is larger than the density of the mobile phone display the same image of the area to be large, to show the same area you have to make the picture smaller. Next to the question above, assume that the width of the picture displayed on my hdpi screen is x, which satisfies the following equation:
6:8=x:30.


Can get x=22.3, take the whole number back to 23.

From:http://www.bafenbaosoft.com/post/40.html

"Go" to fully understand Android ldpi, MDPI, hdpi, xhdpi, xxhdpi folder meaning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.