What are Device Independent Pixels?

Hello there (:

I've been wondering this throughout the use of Iris. What exactly are Device Independent Pixels?

At first I thought it was like Percent, but being relative to the total device size, rather than the width or height respectively (kind of like using viewport width (vw) for both width and height of an element in HTML to make it square, but still relative to the screen size). That doesn't seem to be what it is though, because it is highly dependent on the device how big the pixels are. So perhaps "device independent" doesn't mean "relative size", but rather "absolute size". I.e. 300Dp are always 3cm. But that didn't really seem to be the case either.

Could anyone clear this up for me, please?

Thanks again!

Cheers

Hi Marcel, dp units are calculated based upon the actual pixel size of the screen, so it is more closer to absolute however like you observed it is dependent upon the resolution.

Our documentation mentions DP units here:
https://opensource.hcltechsw.com/volt-mx-docs/docs/documentation/Iris/iris_widget_prog_guide/Content/FlexContainerRules.html#device-independent-pixels

Android has some more information on it here including the conversion formula between pixels and DP units:

https://developer.android.com/training/multiscreen/screendensities#TaskUseDP

Cheers,

Gunndarr