Quote Originally Posted by WILL View Post
Now I know that these do not match up with what Google specifies as it's preferred dp sizes. However this is my problem. How can I make my layouts match up with what Google proposes, which to my opinion is a rather tiny scale of (dp) pixels, dots, tiny blobs of colour, whatever you want to call it. I need to display all 19x19 tiles and they are only 16x16 in pixel size so it's not like I can pretend to smoosh them into individual 8x8 or 4x4 dp space and imagine everything will be ok. The dp unit scale size they specify is just TOO SMALL to design a nice interface going with their numbers.
Why is dp unit scale size too small? Small sized screens (2 to 3 inch in size) have athleast 426dp x 320dp units. This means that each tile could be 16dp x 16dp in size. (320dp / 19 = 16,84).
Now the number of actual pixels that each dp have depends on DPI and is calculated like this: px = (DPI / 160).


Quote Originally Posted by WILL View Post
I need to either limit stupidly small screens or fortify some kind of screen-space guarantee in the game code that I can fit 19 of my map tiles from top to bottom and still have a fair enough space on screen on either side to fit my virtual game controls. If I we can't hit *every* device under the sun, thats ok (people are smart enough to know what they are buying) as long as the ones our game does supports will at least look nice.
So if you have each tile 16dp x 16dp in size tihs means that for rendering the map you would need 16dp * 19 = 304dp. This means that you still have 426dp - 304dp = 122dp combined or 61 dp of space on each side of the map for rendering your virtual controls.

NOTE: For my calculations I used dp resolution for small sized screens as presented on Android developr site. If I understood what is written there you need to request actuall dp resolution from the OS itself since some versions of Android OS can have their own permamently visible controls which would mean that you actually have less space available.


You see dp is actualy a new measuring unit (similar as inches, cm, etc.) which will tel you how big will your UI controll be on your device independently of devices DPI and screen size. So if you you place several devices with different DPI's and screen sizes and all of them have size for one control defined as 20dp x 30dp this controll would look the sime size on all of theese devices. Well there is suposed to be some smal deviation in actual size.
If you look at table defining dp sizes for different sized screens you see htat larger the screen is more dp it has (bugger surface).

The main advantage of using controls whose size is defined with dp-s is that OS actualy takes care about caclulating width and height of your controll in actual screen pixels.
Disadvantae of this is that one dp may actually be 1,5 x 1,5 screen pixels in size which would lead to quality loss when scaling images.