# Drawing UI using density pixels

I have a question about proper ways to draw UI, since I've learned what I know from the internet and by experimenting I often dont code the "proper" way, instead I do it my own way, not knowing if it will have consequenses that Im unaware of. So, Is it "wrong" to draw your UI using density pixels?

For Example:

canvas.drawText(bullets, this.getWidth() - 134 * dp, 32 * dp, paint);


I try to use getWidth() and getHeight() as much as possible but sometimes I just need to use constants in my code to place stuff where I want it, is this ok as long as I use dp? or will this effect the layout on screens with different resolutions/performance? (Don't have anything except my own to run the game on)