Android Screen Related concepts (1)

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 (PPI density)

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

Calculation formula: Pixel density =√{(length pixels ^2+ width Prime number ^2)}/screen size

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. Unit conversions

getresources (). Getdimensionpixeloffset (r.dimen.activity_vertical_margin1);

    • Getdimension

Gets the value of a dimen, if it is a DP or SP unit, multiplies it by density, and if it is PX, returns the float

    • Getdimensionpixeloffset

Gets the value of a dimen, if it is a DP or SP unit, multiplies it by density and, if it is PX, returns an int

    • Getdimensionpixelsize

Whether the DP or SP or PX is written, it is multiplied by denstiy.

Android Screen Related concepts (1)

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.