I've checked android's website about supporting multiple screens but I'm a little confused by dpi. I've a Samsung s7 (not the edge) and I test my app on it. I'm not sure if it's in the mdpi or hdpi group.
Thank you
you can use
float density = getResources().getDisplayMetrics().density; in your app.
and can check if the current device is mdpi, hdpi, xhdpi etc.
Here is link to official docs.
Samsung s7 is of 1440x2560 resolution, which is a xxxhdpi device.
Normally,
hdpi: 480X800
xhdpi: 720X1280
xxhdpi: 1080X1920
xxxhdpi: 1440X2560
Related
Are there xxxhdpi density devices?
Android devices screen density increases (see https://github.com/paulvi/displayclasses) and there are already devices with density higher than xxhdpi (extra-extra-high) ~480dpi
like Samsung Galaxy S6 577 2560 1440
(But I cannot check if it is really xxxhdpi)
Is it time to prepare 192x192 icons?
(4x times 48x48 dp, see http://developer.android.com/design/style/iconography.html )
See also Android Official Icons for XXHDPI and XXXHDPI
UPDATE: Was asked a year before as Android xxx-hdpi real devices
Also Nexus 6 and Nexus 9 Screen density
Just for reference purpose, now Google maintain a list of devices density and other information at https://design.google.com/devices/ which is mainly targeted for material design guideline.
Are there xxxhdpi density devices?
Afaik Nexus 6 is xxxhdpi device
New phones already use XXXHDPI.
Our test phone Samsung S6 Edge use xxxhdpi drawable resources. Someone already mentioned that Nexus 6 also using this dimension. Thus new phones with good screen should use this dimension.
xxxhdpi density devices Resolutions :
2048x1536
2560x1536
2560x1600
In Nexus 6
For more help :
http://developer.android.com/guide/practices/screens_support.html
Actually, no, even as of 2016, there are still no xxxhdpi device.
The largest resolution on Android device is used by Xperia Z5 Premium (4k on 5.5", or roughly 806ppi), and even on that device, it was only used that humongous screen density for multimedia contents. The UI itself was rendered by halving the effective density by two, so it actually scales down from 4k to full HD on 5.5", or xxhdpi.
Specs for Xperia Z5 Premium : http://www.gsmarena.com/sony_xperia_z5_premium-7536.php
I found 8 corresponding devices here.
My Samsung S22, released in February 25, 2022, has a 600 dpi when resolution is set to its highest (3088 x 1440), and more importantly, it loads xxhdpi resources, which means that we aren't there yet in terms of smartphones with 640 DPI or more screen density, and even if your phone contains 600 dpi like my S22 does, which is just 40 dpi shy off 640, it'll still load the 480 dpi (xxhdpi) resources.
I guess we'll get to 640 dpi in a year or two, I also expect the AOSP to add a xxxxhdpi to the source code very soon just as xxxhdpi was added in 2013, long before any 640 dpi handset was released.
The Google Nexus 10 comes out shortly, and is the first device to use xxhdpi resources. It sports a display density of about 300 DPI (according to the Nexus 10 website and this calculator).
However, when I go to the Android documentation, it states:
ldpi : ~120dpi
mdpi : ~160dpi
hdpi : ~240dpi
xhdpi : ~320dpi
xxhdpi is not specified.
How come the Nexus 10's 300 DPI screen is xxhdpi instead of xhdpi, and what should be the approximate DPI of xxhdpi? Should we even worry about having new resources (aside from icons) for xxhdpi at this point, or should we just let the OS scale up xhdpi resources?
According to the post linked in the G+ resource:
The gorgeous screen on the Nexus 10 falls into the XHDPI density
bucket. On tablets, Launcher uses icons from one density bucket up
[0] to render them slightly larger. To ensure that your launcher icon
(arguably your apps most important asset) is crisp you need to add a
144*144px icon in the drawable-xxhdpi or drawable-480dpi folder.
So it looks like the xxhdpi is set for 480dpi. According to that, tablets use the assets from one dpi bucket higher than the one they're in for the launcher. The Nexus 10 being in bucket xhdpi will pull the launcher icon from the xxhdpi.
Source
Also, was not aware that tablets take resources from the asset bucket above their level. Noted.
xxhdpi was not specified before but now new devices S4, HTC one are surely comes inside xxhdpi .These device dpi are around 440. I do not know exact limit for xxhdpi See how to develop android application for xxhdpi device Samsung S4
I know this is late answer but as thing had change since the question asked
Note Google Nexus 10 need to add a 144*144px icon in the drawable-xxhdpi or drawable-480dpi folder.
The DPI of the screen of the Nexus 10 is ±300, which is in the unofficial xhdpi range of 280‑400.
Usually, devices use resources designed for their density. But there are exceptions, and exceptions might be added in the future.
The Nexus 10 uses xxhdpi resources when it comes to launcher icons.
The standard quantised DPI for xxhdpi is 480 (which means screens with a DPI somewhere in the range of 400‑560 are probably xxhdpi).
480 dpi is the standard QUANTIZED resolution for xxhdpi, it can vary something less (i.e.: 440 dpi) or more (i.e.: 520 dpi). Scale factor: 3x (3 * mdpi).
Now there's a higher resolution, xxxhdpi (640 dpi). Scale factor 4x (4 * mdpi).
Here's the source reference.
The resolution is 480 dpi, the launcher icon is 144*144px all is scaled 3x respect to mdpi (so called "base", "baseline" or "normal") sizes.
The newer android phones in the market like HTC one, Xperia Z etc have resolutions in the >480dpi range, putting them in the new xxhdpi class as well. The new assets might be useful for them too.
A set of four generalized sizes: small, normal, large, and xlarge
Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.
A set of six generalized densities:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi
From developer.android.com : http://developer.android.com/guide/practices/screens_support.html
As per this PPI calculation tool, Google Nexus 10 has a display density of about 300 DPI...
However, Android documentation states that:
ldpi : ~120dpi
mdpi : ~160dpi
hdpi : ~240dpi
xhdpi : ~320dpi
xxhdpi is not specified.
I think we just let Android OS scale up xhdpi resources...
Should we use XHDPI images for retina display in Android? If not, where should I place images/assets for the Samsung Galaxy S3.
Update:
I found a useful artical:
List of Android Devices with pixel density buckets
The Samsung Galaxy S3 got a density of around 309 pixels per inch. From the Android documentation on supporting multiple screen densities:
xhdpi: Resources for extra high-density (xhdpi) screens (~320dpi)
I think we can conclude that assets for the S3 should be placed in the xhdpi folder.
The Google Nexus 10 comes out shortly, and is the first device to use xxhdpi resources. It sports a display density of about 300 DPI (according to the Nexus 10 website and this calculator).
However, when I go to the Android documentation, it states:
ldpi : ~120dpi
mdpi : ~160dpi
hdpi : ~240dpi
xhdpi : ~320dpi
xxhdpi is not specified.
How come the Nexus 10's 300 DPI screen is xxhdpi instead of xhdpi, and what should be the approximate DPI of xxhdpi? Should we even worry about having new resources (aside from icons) for xxhdpi at this point, or should we just let the OS scale up xhdpi resources?
According to the post linked in the G+ resource:
The gorgeous screen on the Nexus 10 falls into the XHDPI density
bucket. On tablets, Launcher uses icons from one density bucket up
[0] to render them slightly larger. To ensure that your launcher icon
(arguably your apps most important asset) is crisp you need to add a
144*144px icon in the drawable-xxhdpi or drawable-480dpi folder.
So it looks like the xxhdpi is set for 480dpi. According to that, tablets use the assets from one dpi bucket higher than the one they're in for the launcher. The Nexus 10 being in bucket xhdpi will pull the launcher icon from the xxhdpi.
Source
Also, was not aware that tablets take resources from the asset bucket above their level. Noted.
xxhdpi was not specified before but now new devices S4, HTC one are surely comes inside xxhdpi .These device dpi are around 440. I do not know exact limit for xxhdpi See how to develop android application for xxhdpi device Samsung S4
I know this is late answer but as thing had change since the question asked
Note Google Nexus 10 need to add a 144*144px icon in the drawable-xxhdpi or drawable-480dpi folder.
The DPI of the screen of the Nexus 10 is ±300, which is in the unofficial xhdpi range of 280‑400.
Usually, devices use resources designed for their density. But there are exceptions, and exceptions might be added in the future.
The Nexus 10 uses xxhdpi resources when it comes to launcher icons.
The standard quantised DPI for xxhdpi is 480 (which means screens with a DPI somewhere in the range of 400‑560 are probably xxhdpi).
480 dpi is the standard QUANTIZED resolution for xxhdpi, it can vary something less (i.e.: 440 dpi) or more (i.e.: 520 dpi). Scale factor: 3x (3 * mdpi).
Now there's a higher resolution, xxxhdpi (640 dpi). Scale factor 4x (4 * mdpi).
Here's the source reference.
The resolution is 480 dpi, the launcher icon is 144*144px all is scaled 3x respect to mdpi (so called "base", "baseline" or "normal") sizes.
The newer android phones in the market like HTC one, Xperia Z etc have resolutions in the >480dpi range, putting them in the new xxhdpi class as well. The new assets might be useful for them too.
A set of four generalized sizes: small, normal, large, and xlarge
Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.
A set of six generalized densities:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi
From developer.android.com : http://developer.android.com/guide/practices/screens_support.html
As per this PPI calculation tool, Google Nexus 10 has a display density of about 300 DPI...
However, Android documentation states that:
ldpi : ~120dpi
mdpi : ~160dpi
hdpi : ~240dpi
xhdpi : ~320dpi
xxhdpi is not specified.
I think we just let Android OS scale up xhdpi resources...
I want to test for Moto razr
In which my control will go, ldpi or mdpi or Hdpi? Please see specification for detail of the device. There is some UI issue so I want to know that.
It depends on your device's density(dpi).
Ldpi - 120dpi and above
Mdpi - 160dpi and above
Hdpi - 240dpi and above
XHdpi - 320dpi and above
As Moto Razr having 256dp so it will use the resource from Hdpi.
http://developer.android.com/guide/practices/screens_support.html#range
Motorola RAZR XT910 is ~256 dpi screen and most likely that it looks for HDPI Resource before MDPI.