1

How can I identify a device that does has a HD-Screen such the Asus HD?

I did some research and find some parameters on which i'm trying to calculate that.

Where the first info is from GSM arena (size and ppi) and the DisplayMetrics collected from the device trough getDisplay().getDisplayMetrics();

Asus HD - 1920 x 1200 pixels, 10.1 inches (~224 ppi pixel density) - DisplayMetrics{density=1.5, width=1920, height=1128, scaledDensity=1.5, xdpi=159.89508, ydpi=159.58115}
GTab - 800 x 1280 pixels, 10.1 inches (~149 ppi pixel density) - DisplayMetrics{density=1.0, width=800, height=1280, scaledDensity=1.0, xdpi=160.15764, ydpi=160.0}
Xoom - 800 x 1280 pixels, 10.1 inches (~149 ppi pixel density) -  DisplayMetrics{density=1.0, width=1280, height=752, scaledDensity=1.15, xdpi=149.82489, ydpi=149.41176}
Xoom 2 ME - 800 x 1280 pixels, 8.2 inches (~184 ppi pixel density) - DisplayMetrics{density=1.0, width=1280, height=752, scaledDensity=1.0, xdpi=149.82489, ydpi=149.41176}
nexus 7 - 800 x 1280 pixels, 7.0 inches (~216 ppi pixel density)
nexus 7 2 - 1200 x 1920 pixels, 7.0 inches (~323 ppi pixel density)
Gnote II - 720 x 1280 pixels, 5.5 inches (~267 ppi pixel density)
Gnote - 800 x 1280 pixels, 5.3 inches (~285 ppi pixel density)
Gtab 7.7 - 800 x 1280 pixels, 7.7 inches (~196 ppi pixel density)
Gtab 7 - 600 x 1024 pixels, 7.0 inches (~170 ppi pixel density)

I tought using density as the parameter to identify it, but most devices return 1.0 (at least Asus HD does return 1.5) but I'm not sure that I can rely on those values.

There's any better aproach to identify then?

Charles
  • 50,943
  • 13
  • 104
  • 142
Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
  • How are you defining "HD-Screen"? – CommonsWare Jul 26 '13 at 21:48
  • Actually, to me is a device on which the ppi is very-high (by consequence the image does looks better and should be at higher resolutions) – Marcos Vasconcelos Jul 26 '13 at 21:50
  • And that does not imply on targeting xhdpi devices since those can still be not HD (such Galaxy Tab 10.1 and Motorola Xoom). – Marcos Vasconcelos Jul 26 '13 at 21:51
  • 2
    Since neither the Tab 10.1 nor the Motorola XOOM are `-xhdpi` devices, you have some flaws in your analysis. For example, if you read your own question, you will see that the XOOM (third line down in your roster) is `-hdpi`. – CommonsWare Jul 26 '13 at 22:06
  • Sorry -- off-by-one error in my previous comment. XOOM and the Tab 10.1 are `-mdpi` devices. `-xhdpi` will be WXGA phone-sized screens and 1080p tablet-sized screens. – CommonsWare Jul 26 '13 at 22:26
  • Hmm.. i did believe that those are xhdpi devices.. I'll check those values (monday) so and update the question if needed, thanks in advance. – Marcos Vasconcelos Jul 26 '13 at 22:48
  • There is a decent list of some density's here: http://blog.blundell-apps.com/list-of-android-devices-with-pixel-density-buckets/ , xoom is mdpi – Blundell Jul 27 '13 at 00:06

1 Answers1

0

Regardless of the argument over "what is HD". If you want something based on Denisty; Do it with resource qualifiers:

In the files:

/values-xxxhdpi/hd.xml
/values-xxhdpi/hd.xml
/values-xhdpi/hd.xml

hd.xml:

<resources>
  <bool name="isWhatIClassifyAsHD">true</bool>
</resources>

(setting the below is optional as they would be false anyway).

/values/hd.xml
/values-mdpi/hd.xml
/values-hdpi/hd.xml

hd.xml:

<resources>
  <bool name="isWhatIClassifyAsHD">false</bool>
</resources>

Then in your activity:

 boolean isHD = getResources().getBoolean(R.bool.isWhatIClassifyAsHD);
Blundell
  • 75,855
  • 30
  • 208
  • 233