Cell phone screen size, resolution, density, DPI, dip, PX, SP, etc.

Source: Internet
Author: User
Tags home screen
Document directory
  • 1: Main Screen Size
  • 2: Mobile Phone size
  • 1: pixel (PX)
  • 2: Resolution resolution
  • 3: density Density
  • 4: DPI densitydpi
  • 5: Dip (DP) device independent Pixel
  • Note: There is a formula
  • 6: SP pixel Amplification
  • 7: Resolution of each screen

I have never been very clear about the cell phone size and screen resolution, so I spent some time learning about it and make a summary. If something is wrong, I still hope to correct it.

The following uses my mobile phone Huawei c8813 as an example. The parameters are as follows:

Main screen size: 4.5 inch

Home screen resolution: 854x480

Phone size: 132.5X67X9.3

I. screen size 1: Main Screen Size

The diagonal line length of the main screen (not the length of the entire phone)

The value is 1 inch = 2.54

So 4.5 inch = 4.5*2.54 = 11.43. Generally, the screen size of the mobile phone is the size of the main screen, rather than the area of the mobile phone.

2: The mobile phone size indicates the actual size of the mobile phone (the entire mobile phone), also known as the physical size of 132.5X67X9.3mm, where 3mm is the thickness of 2: screen resolution Android gets the screen resolution as follows: displaymetrics metrics = NewDisplaymetrics (); getwindowmanager (). getdefadisplay display (). getmetrics (metrics ); IntWidth = metrics. widthpixels; ------------- 480 (c8813 parameter) IntHeight = metrics. heightpixels; ----------- 854 IntDensity = ( Int)
Metrics. density; -------- 1 IntDensitydpi = metrics. densitydpi ;---------
240

1: pixel (PX)

Resolution: first, pixels are composed of letters from picture and element. The smallest unit of image imaging, the higher the pixel, the richer the color palette, and the more realistic the color.

Different devices have the same display effect. The "same" indicates that the number of pixels remains unchanged. For example, if the specified UI length is PX, the UI length is PX regardless of the resolution. It is precisely because of this that the UI is magnified and distorted on a small resolution device, and scaled down on a large resolution device. 2: Resolution resolution Definition 1: Total number of pixels on the screen. Note that although the resolution is expressed as "Broadband x length" in most cases, the resolution does not mean the aspect ratio of the screen. Definition 2: Number of pixels in the vertical and horizontal directions of the mobile phone screen. For example, if the resolution is 480*320, the device has 480 pixels vertically and 320 pixels horizontally. In the above two definitions, the meaning is similar. The definition 2 of personal perception is more accurate. Currently, my c8813 resolution is: 854x4803: density definition: the number of workers per square foot. Common Value: 0.75/1/1.5 IntDensity
= ( Int)
Metrics. density; 4: DPI densitydpi definition: Number of workers per foot. (Dots per inch pixel density) for example: 240 DPI indicates that there are 240 pixels at a distance per foot on the mobile phone either horizontally or vertically. When the resolution of c8813 is 854x480, the screen length is 854/240 feet, and the width is 480/240 feet. IntDensitydpi
= Metrics. densitydpi; 5: Dip (DP) device independent pixel Dip (device-independent pixel), "DP" in the layout, not dependent on pixels, this is the recommended unit for Android to use DP in layout. note: There is a formula Dip (DP) = device density DPI/160 * pixel = DPI/160 * pixel for example: the device density of c8813 is densitydpi = 240 So dip = 240/160 * pixel = 1.5 Pixel

If DPI = 160, 1dp = 1 pixel (PX)

6: SP magnification pixels are mainly used for font display (best for textsize ). According to Google's suggestion, it is best to use SP as the unit for the font size of textview, and check the source code of textview. Android uses SP as the font size unit by default.

7: Resolution of each screen

Qvga: resolution 240*480 (quarter VGA is 1/4) hvga: resolution 320*480
(Half-size VGA: Half) VGA: Resolution: 640*480 (full name: Video graphic array) WVGA: Resolution: 800*480
(Many web pages of wide VGA are 800 in width, so WVGA's mobile phone screen is more suitable for Webpage Browsing) fwvga: Resolution: 854*480
The cell phone c8813 is different from other resolutions.

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.