I am designing a layout as per a set of specification. I basically need to give some space between the layout and the android device. Below image is for reference
I am using following site to convert given pixel into dp values AndroidPixelConverter
I am giving px value in xxxhdpi column and getting its respective dp value, which I am placing it in my xml layout.
The primary phones that I am testing on is Samsung S4 and Nexus5
Following are my questions:
- According to this site Nexus5 and Samsung S4 belongs to xxhdpi resolution but still I am getting the correct pixel value if I use the xxxhdpi column in the above mentioned AndroidPixel Converter site. Why is this ?
- Nexus5 has soft navigation bar where as Samsung S4 has hard button as navigation. How can I detect it and accordingly give values to my layout. The navigation bar, if I am not wrong is of 144px in height, if not present will change the layouts dimension. How can I handle this ?
Lastly, is the method which I am following the correct one? If no, please guide in the correct way.
P.S: I am looking for pixel perfect layouts across all devices. Is it possible ?