We explain the essence of Screen Density (Density Buckets) in Android — the classification of screens by pixel density: mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi. Screen Density determines how many physical pixels fit in one inch of the screen and directly affects how images and interface are displayed on different devices. According to the Google Android Compatibility Definition (2025), Android supports 6 main Density Buckets and up to 8 additional ones for foldable devices.
Key Takeaways
Screen Density is the number of physical pixels per inch of screen (ppi — pixels per inch, or dpi — dots per inch). Android uses the concept of Density Buckets — groups of screens with similar density that use the same scaling factors. Unlike resolution (number of pixels in width and height), density determines the physical size of a pixel on the screen. According to the Google Pixel Team (2025), the density of modern flagships is 450-550 ppi, which corresponds to the xxhdpi-xxxhdpi bucket.
The Density Bucket system appeared in Android 1.6 Donut (2009) with the first devices at 160 dpi (mdpi). As screen resolutions grew, new buckets were added: hdpi (Android 1.6), xhdpi (Android 2.3), xxhdpi (Android 4.1), xxxhdpi (Android 4.4). Each new bucket reflected a 1.5× or 2× increase in density over the previous one. According to the Android Open Source Project (2025), 96% of active Android devices now have densities ranging from hdpi to xxxhdpi.
Density Buckets are density ranges defined by Google for grouping Android screens. The base bucket is mdpi (160 dpi). The scale factor shows how many times larger a resource for a given bucket is compared to mdpi. For example, xhdpi (2×) means the image should be 2 times larger in width and height than its mdpi version. According to Android Studio Resource Manager (2025), xxhdpi is the most common bucket among active devices (38% market share), followed by xhdpi (28%).
| Bucket | DPI Range | Scale | Device Example | Market Share (2025) |
|---|---|---|---|---|
| ldpi | 120 dpi | 0.75× | Old budget devices | Less than 1% |
| mdpi | 120-160 dpi | 1× | HTC Dream (G1), 7" tablets | 3% |
| hdpi | 160-240 dpi | 1.5× | Samsung Galaxy S2, Nexus 4 | 12% |
| xhdpi | 240-320 dpi | 2× | Google Nexus 5, Moto G | 28% |
| xxhdpi | 320-480 dpi | 3× | Samsung Galaxy S8, Pixel 3 | 38% |
| xxxhdpi | 480-640 dpi | 4× | Samsung Galaxy S24 Ultra, Pixel 9 Pro | 18% |
Screen Resolution is the total number of pixels in width and height (e.g., 1080×2400). Screen Density is the number of pixels per inch. Two devices with the same resolution can have different densities if their physical screen sizes differ. For example, a 6-inch phone with a resolution of 1080×2400 has a density of about 440 dpi (xxhdpi), while a 5-inch phone with the same resolution has about 530 dpi (xxxhdpi). This is a key difference: the interface should adapt not to resolution but to density, otherwise elements will be too small on high-density devices.
Android uses qualifiers in res folder names to load resources for a specific screen density: drawable-mdpi, drawable-hdpi, drawable-xhdpi, drawable-xxhdpi, drawable-xxxhdpi. When the application starts, Android selects resources from the folder that best matches the device density. If there's no exact match, the system uses the nearest bucket or scales a resource from a lower density. According to Android Docs (2025), density qualifiers are not needed for vectors (VectorDrawable) — they scale automatically.
/res/
drawable-mdpi/
icon_app.png (48x48 px)
drawable-hdpi/
icon_app.png (72x72 px)
drawable-xhdpi/
icon_app.png (96x96 px)
drawable-xxhdpi/
icon_app.png (144x144 px)
drawable-xxxhdpi/
icon_app.png (192x192 px)
In this structure, each folder contains the same icon but at a different physical pixel size. The base size of 48×48 pixels for mdpi is multiplied by the scale factor for each bucket. Android automatically selects the correct file based on the device's DisplayMetrics.density. For VectorDrawable (XML format), a single file in drawable/ is sufficient — the system scales it without quality loss.
Calculating the size of an image for each density is based on a simple formula: size in mdpi × scale factor. If an icon in mdpi is 48×48 px, then for hdpi it will be 72×72 px (48 × 1.5), for xhdpi — 96×96 px (48 × 2), for xxhdpi — 144×144 px (48 × 3), for xxxhdpi — 192×192 px (48 × 4). According to Material Design Guidelines (2025), this formula applies to all raster resources: icons, backgrounds, images, and 9-patch.
| Bucket | Scale | mdpi Size (px) | Bucket Size (px) |
|---|---|---|---|
| mdpi | 1× | 48×48 | 48×48 |
| hdpi | 1.5× | 48×48 | 72×72 |
| xhdpi | 2× | 48×48 | 96×96 |
| xxhdpi | 3× | 48×48 | 144×144 |
| xxxhdpi | 4× | 48×48 | 192×192 |
Proper preparation of resources for Density Buckets includes five key rules. First, use VectorDrawable for simple icons — this eliminates the need for five copies. Second, for raster images, export all densities from design tools (Android Studio Asset Studio generates them automatically). Third, avoid placing images in drawable/ without a qualifier — the system will scale with quality loss. Fourth, test on a device with a density different from your primary one — the emulator allows changing density. Fifth, use WebP instead of PNG — according to Google (2025), WebP gives 25-35% smaller size at the same quality.
Frequently Asked Questions
mdpi (medium-density pixel-independent) — the base Density Bucket in Android with a density of 160 dpi. All other buckets are calculated relative to mdpi: hdpi — 1.5×, xhdpi — 2×, and so on. mdpi corresponds to one physical pixel per density-independent pixel (dp). Designers use mdpi as a reference when creating layouts.
Use DisplayMetrics: getResources().getDisplayMetrics().density returns the scale factor (1.0 for mdpi, 3.0 for xxhdpi). To programmatically determine the bucket, call getResources().getConfiguration().densityDpi. Android Studio also has a Device Explorer that shows densityDpi for connected devices.
Technically — yes, but with quality loss. If a resource is only available in drawable-xxhdpi, on an mdpi device it will be scaled down by 3× — the image will become blurry. If the resource is only in mdpi, on xxhdpi it will be scaled up — pixelation. It is recommended to prepare at least for xhdpi, xxhdpi and xxxhdpi — this covers 84% of active devices (2025). For VectorDrawable, a single file without a qualifier is sufficient.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also