DPI stands for Dots Per Inch. It is a measurement of screen density, indicating how many individual dots (or pixels) fit into one inch of the display. The higher the DPI, the more tightly packed the pixels are, resulting in sharper and clearer visuals.
Although related, DPI is different from screen resolution. Resolution refers to the total number of pixels (e.g., 1920×1080), while DPI describes how densely those pixels are arranged per inch.
Android classifies devices into standard screen density buckets to simplify UI scaling. These categories help developers design responsive UIs:
DPI Category | Approximate DPI | Description |
---|---|---|
ldpi | ~120 dpi | Low-density screens |
mdpi | ~160 dpi | Baseline (medium density) |
hdpi | ~240 dpi | High-density screens |
xhdpi | ~320 dpi | Extra-high density |
xxhdpi | ~480 dpi | Extra-extra-high density |
xxxhdpi | ~640 dpi | Extra-extra-extra-high density |
In addition to DPI, Android also categorizes screen physical size using the following qualifiers:
These size categories help developers design layouts that adapt to physical screen space, not just pixel density. For example, a normal screen with xxhdpi may still display content differently than a large screen with mdpi.
Combining both DPI and screen size categories allows Android to select the best layout and image assets for every device. Developers often provide:
drawable-xhdpi
)layout-large
, layout-xlarge
)This ensures a consistent user experience, regardless of screen sharpness or physical dimensions.
Screen DPI determines how sharp content appears, while screen size categories define how much content can fit on screen. Understanding both is essential for creating flexible, high-quality Android applications that run smoothly on all types of devices.