Android: what UI element size element to use (if dp doesn't work)

Im developing an application that will be used on the Samsung Galaxy SII and the Samsung Galaxy 7.7 tab ONLY. The sizes of all user interface elements are specified in dp, as recommended in the Android Developer's Guide. As I understand it, this would ensure that the elements retain the same perceived size for the user on different screens. My problem is that all user interface elements look much smaller on a 7.7-inch device (about 2/3 of what they look like in SII).

I would like them to be the same size on the tablet, or perhaps even larger. I tested various formats of the device for measuring size, and when I specify them in inches or mm, they have the same size, and when in px they are larger on the tablet.

But is this really the right approach to use any of these three devices, and if so, why does Android recommend dp?

I hope someone there can clarify this :)

+3
source share
2 answers

Dp works in most cases, but if I were you, I would specify different layout folders, in this case the layout is xlarge / for your 7.7-inch device and the layout is normal / for your Galaxy SII.

XML / , .

enter image description here

: http://developer.android.com/guide/practices/screens_support.html#support

+1

, , .

dp , , .

dp densityDpi , dpi, true dpi . , dp, .

, , , .

, 7,7- ( 2/3 , SII).

Samsung Galaxy S2 dpi 218 240 Dpi, dp 10% , , dpi Dpi.

Samsung Galaxy Tab 7.7 dpi 197 160 Dpi, dp- 81% , , dpi Dpi.

, dpi . , , , dp, 35% Galaxy S2 Galaxy Tab 7.7

, , , . , , , px .

, dpi , , 7.7 , dpi, s2.

dpi , , , , , .

, , , , , . . Lint () () ?

, , Android dp?

mm/inch, dp, , , , , .

- /, , , , dp. dp , , , x dp . , , , .

, - / , /. , - .

+1

All Articles