You can use adb commands here:
one like adb shell getprop ro.sf.lcd_density
or adb shell dumpsys window | grep DisplayWidth
.
adb shell dumpsys window displays will return something like `init=1440x2560 640dpi cur=1440x2560 app=1440x2392 rng=1440x1340-2392x2292` in third line , may be you can use this .
Hope this helps .
Thanks,
Donald