Supporting different screens and Samsung s7 dpi

1.7k views Asked by At

I've checked android's website about supporting multiple screens but I'm a little confused by dpi. I've a Samsung s7 (not the edge) and I test my app on it. I'm not sure if it's in the mdpi or hdpi group. Thank you

2

There are 2 answers

0
Junaid Hafeez On

you can use float density = getResources().getDisplayMetrics().density; in your app. and can check if the current device is mdpi, hdpi, xhdpi etc. Here is link to official docs.

2
nnn On

Samsung s7 is of 1440x2560 resolution, which is a xxxhdpi device. Normally,

hdpi: 480X800
xhdpi: 720X1280
xxhdpi: 1080X1920
xxxhdpi: 1440X2560