"Go" Android Phone resolution basics (DPI,DIP calculation)

Source: Internet
Author: User

1. Terminology and concepts

Terms

Description

Note

Screen size

Refers to the actual physical size of the phone, such as the usual 2.8-inch, 3.2-inch, 3.5-inch, 3.7-inch

Motorola milestone phone is 3.7 inches

Aspect Ratio (width/height ratio)

Refers to the actual physical dimensions of the width-to-height ratio, divided into long and nolong

Milestone is 16:9, belongs to Long

Resolution (resolution)

The same as the computer resolution concept, refers to the phone screen vertical, horizontal direction of the number of pixels

Milestone is 854*480.

DPI (dot per inch)

Pixels per inch, such as 120dpi,160dpi, assume that the screen physical size of the QVGA (320*240) Resolution is (2 inches * 1.5 inches), dpi=160

Can reflect the sharpness of the screen, which is used to scale the UI

Density (Density)

The pixel concentration in the screen, Resolution/screen size can reflect the cell phone density,

Density-independent Pixel (DIP)

Refers to the logical density unit, the corresponding formula for dip and specific pixel values is dip/pixel=dpi value/160, which is PX = DP * (dpi/160)

2. DPI value calculation

For example: Calculate WVGA (800*480) resolution, 3.7-inch density dpi,1 shown

Figure 1

Diagonal pixel represents the pixel value (=) of the diagonal, dpi=933/3.7=252

3. Classification of mobile phone screen

3.1 According to the cell phone screen density (DPI) or screen size is divided into the following 3 classes, 2 shows

Figure 2

3.2 The corresponding relationship between screen classification and pixel density of mobile phones is shown in table 1:

Low density (+), ldpi

Medium density (), mdpi

High Density (hdpi),

Small screen

QVGA (240x320)

Normal screen

WQVGA400 (240x400) WQVGA432 (240x432)

HVGA (320x480)

WVGA800 (480x800) WVGA854 (480x854)

Large screen

wvga800* (480x800) wvga854* (480x854)

Table 1

3.3 Mobile phone size distribution (http://developer.android.com/resources/dashboard/screens.html) 3, is mainly based on the resolution of 800*480 and 854*480 mobile phone users mostly

Figure 3

From the above screen size distribution, in fact, the phone just consider 3-4.5-inch density of 1 and 1.5 of mobile phones

4 UI Design

From a development perspective, the application will provide 3 sets of UI layout files based on the 3-class Android phone screen, but the corresponding interface icons also need to provide 3 sets, as shown in table 2

Icon Type

Standard Asset Sizes (in Pixels), for generalized screen densities

Low density screen (ldpi)

Medium density screen (MDPI)

High density screen (hdpi)

Launcher

X × px

x px

x px

Menu

X × px

x px

x px

Status Bar

x px

x + px

x px

Tab

x px

x + px

x px

Dialog

x px

x + px

x px

List View

x px

x + px

x px

Table 2

5 How do I adapt to the screen size?

1) Interface layout aspect

It is necessary to prepare 5 sets of layouts according to the size of the physical size, layout (put some common layout XML files, such as the top and bottom layouts in the interface, will not change with the screen size, like the title bar of the WinDOS window), Layout-small ( Screen size less than 3 inches in layout), layout-normal (screen size less than 4.5 inches or so), Layout-large (4 inches-7 inches), Layout-xlarge (7-10 inches)

2) Picture Resources

5 sets of picture resources need to be prepared according to the DPI value, drawable,drawalbe-ldpi,drawable-mdpi,drawable-hdpi,drawable-xhdpi

Android has an automatic matching mechanism to select the corresponding layout and picture resources

from:http://blog.csdn.net/moruite/article/details/6028547

"Go" Android Phone resolution basics (DPI,DIP calculation)

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.