Here is some examples to define dimension using XML.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="one_pixels">1px</dimen>
<dimen name="five_dp">5dp</dimen>
<dimen name="1_inch">1in</dimen>
<dimen name="1_cm">10mm</dimen>
</resources>