Android Question Dip dpi %x %y

Stern0m1

Member
Licensed User
Im confused abour dip,dpi, %x %y. Not sure if really get what this means. Is there a good tutorial (for dummies!) somewhere?

Thanks
 

klaus

Expert
Licensed User
Longtime User
dpi dots per inch number of pixels per inch

dip density insependant pixels pixels with Android standard density of 160dpi
If you set Widht = 160 the physical size on the screen would be:
about 1 inch on a device with a density of 160dpi
about 0.75 inch on a device with a density of 240dpi
about 0.5 inch on a device with a density of 320dpi
If you set Width = 160dip the physical size would be:
about 1 inch on a device with a density of 160dpi
about 1 inch on a device with a density of 240dpi
about 1 inch on a device with a density of 320dpi

%x percent of the screen width
100%x = whole screen width
50%x = middle of screen horizontally on any device, independant of its size and resolution.
%y percent of the screen height
100%y = whole available screen height, screen height minus height of the top bars.
50%y = middle of screen vertically on any device, independant of its size and resolution.
If you turn the device %x and %y will change.

You may have a look at chapter 5 Screen sizes and resolutions in the B4A Beginner's Guide.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
None of both.
Font sizes are expressed in points 1/72 of an inch.
Independant of screen size and resolution.
AutoScale in the Designer Scripts adjusts the font size according to the screen size and AutoScaleRate.
 
Upvote 0
Top