DIP – Density Independent Pixel, is a measurement unit, mainly used in Android, that hides the real screen scale. 160 dips is roughly 1 inch on all devices. Different devices have screens with different scales. The definition of scale in B4A is <number of pixels per inch> / 160.It is a common...
1) Button1.Width = 100dip = 250 pixels
2) Button1.Width = 50dip = 125 pixels
3) Button1.Width = 30dip = 75 pixels
4) Button1.Width = 160dip = 400 pixels > ~ 1 inch = 25.4 mm
A size of 160 dip is about 1 inch. on all devices, density independent.
To get the pixel value you must multiply the dip value by the Scale.
If you are worrying about button sizes in dip dimensions then you are probably not designing your layout in the best way. One might use dips to set the separation between views but the views themselves are best left to find their own best fit using the Designer and anchors, and maybe a Designer script. Here is a slightly complicated example, but there are several others with much simpler layouts that show the principle.
I am not saying that one should never use dip dimensions, but I am saying that when you design a screen layout properly you should not have to worry about the actual pixel dimension of the display, and certainly not about pixel scales and sizes. Usually I can use a single layout even for 'phones and tablets.
Yes, I do. In fact even using variants is often a sign that you are on the wrong path.
When I started working with Android I did exactly what you are doing (worrying about screen dimensions) but it is not necessary; in fact it is the wrong way to go.
Another very useful tool is %x and %y. This works in the Designer too. A code example ...
B4X:
Activity.AddView(panel1, 25%x, 25%y, 50%x, 50%y)
This will add a panel (or a label or an image) that will be in the exact centre of the screen of any device. The point that I am making is that it will work perfectly and we have not even thought about dips or pixel sizes!
Erel has produced some helpful videos using the Designer on You-Tube; make sure that you look them up. Good luck!