What is the difference between PX and dip?
Dip! = Px
It is mainly for different devices. On a device whose density is 160, for example, the default simulator created with avdmanager, dip and PX are the same, but if the sameCodeSwitch to a device with different density, for example, to a device with a density of 240, the size of dip and PX is different. PX is as long as it is on any device,DipBased on device changes; wqvga screen density = 120; qvga screen density = 120; hvga screen density = 160; WVGA screen density = 240; density value indicates the number of display points per inch, resolution and resolution are two concepts.
Resources that use the hdpi label when the screen density is 240
Resources that use the mdpi label when the screen density is 160
Ldpi tag resources are used when the screen density is 120.
Resources without any tags are shared in various resolutions. When layout, use the unit dip as much as possible, and use less PX.
Conversion formula:
Pixs = dips * (densitydpi/160 ).
DIPS = (pixs * 160)/densitydpi