In Android, find the Density-independent pixel (dp)

Previous topic - Next topic

Wampus

Density-independent pixel (dp) gets important for Android devices. Without being able to know what the pixel density is it is hard to know how far to scale the screen.

For example, an app that is designed to work in a 320x480 normal density display could be scaled to fit a 480x800 screen and look ok, but if it was scaled to 640x1024 it would be too large unless the dp was high, in which case it would be correct to scale up that much.

The value could be part of PLATFORMINFO$