Imperative vs Declarative programing
Imperative programing is to describe how to build the result.
Declarative programing is to declare what you want the result to be
i.e. HTML is a declarative UI
Constraint UI strings to resources
When you are writing strings in UIs, it is a better convention to declare strings as resources and give a reference to it because this makes:
Layouts
Android Layout Units
dp = density-independent pixels (dips)
you can use pixels, mm but it depends on pixels-per-inch density.
i.e. 40 pixel in 400 dpi is 10% of the screen, but 40 pixel in 4000 dpi is 1% of the screen