Values ββare in pixels (normal, not dp). It is worth mentioning that in all functions that accept pixel sizes, the sizes are usually the correct pixel sizes. This is true for the width and height of the view, positions, available sizes, etc.
If you want to provide dp instead, there are many conversion functions from dp to pixels. This is a very simple formula.
If you want to decode bitmaps and change the density during the process of decoding a bitmap, look at BitmapFactory.decodeXYZ and carefully look at BitmapFactory.Options in the fields related to density. This can be useful if you want the same source bitmap (for example, a bitmap downloaded from the Internet) to have different pixel sizes on different density devices.
source share