0

Hi Ive been creating UI's for quite some time based on screen densities and screen size categories.

Now I have a weird situation where I have an Android Tablet(8 inches) and a HP Slate(21 inches) with MDPI density and X-Large screen size category.

Can someone please guide me on how the UI's could be created for these devices uniquely though they have the same Android UI specs?

Adi
  • 197
  • 5
  • 16
  • You can take a look at this or keep wasting hours with this kind of problems. http://stackoverflow.com/questions/29956014/why-should-we-use-xml-layouts – Nanoc Nov 03 '15 at 15:54

1 Answers1

1

I have a weird situation where I have an Android Tablet(8 inches) and a HP Slate(21 inches) with MDPI density and X-Large screen size category.

IMHO, your Android tablet is messed up, as an 8" tablet should be -large, not -xlarge. That being said, your underlying point would be valid for, say, a 10.1" tablet, compared with the HP Slate, Samsung Galaxy View (18"), etc.

Also, the Slate 21" really should be -ldpi, but let's assume that HP elected to categorize it as -mdpi.

Can someone please guide me on how the UI's could be created for these devices uniquely though they have the same Android UI specs?

Ignore -large and -xlarge, as they have been obsolete for a while.

Instead, use -wNNNdp, -hNNNdp, and -swNNNdp qualifiers, where NNN are values that you choose, measured in density-independent pixels (dp).

An 8" -mdpi tablet will have a modest resolution (e.g., WXGA, 1280x720). The HP Slate 21" has a 1080p display (1920x1080). 1dp==1px for -mdpi devices, so the 8" tablet has a width of 1280dp and the Slate 21" has a width of 1980dp.

So, res/layout-w1800dp/, for example, would be picked up by the Slate 21" but not your 8" tablet, as the current width of the 8" tablet will not be 1800dp or larger.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Now that makes more sense. Looks like I will have to revisit the the Android UI guidelines once again. Thank you so much. – Adi Nov 03 '15 at 17:48