I have 2 questions about the "DPI" term.
1st, i googled this term, someone said that it means dots per inch. and we can use follow formula to canculate the screen dpi:
dpi = radical(screen_width_pixel^2+screen_height_pixel^2)/screen_inchs
Now, i have an android tv, i found that my tv resolution is 1920*1080, and the dpi is 240, the tv size is 50 inch. But if i use above formula to calculate the dpi, i will get the dpi value is 40, i don't know why? is above formula ppi formula?
2nd, i found that the dpi value is in the build.prop->ro.sf.lcd_density=240, i don't know why the manfacturer set this value, in other words, what is this value based on, why not setting 320 or other values? They user above farmula to get the value and set it?
Thanks a lot!
I have been researching answer to your question for last one day, and reached some conclusions - 1.
Note - I tried on my part to make you understand, if you find any problem understanding my answer, Please comment, would be happy to assist.
Reference # 1
Try this information Iuser lastly to develop and android studio screens
ldpi (low) ~ 120dpi
mdpi (medium) ~ 160dpi
hdpi (high) ~ 240dpi
xhdpi (extra-high) ~ 320dpi
xxhdpi (extra-extra-high) ~ 480dpi
xxxhdpi (extra-extra-extra-high) ~ 640dpi
-
res/values/dimens.xml(default)
res/values-ldpi/dimens.xml (240x320 and nearer resolution)
res/values-mdpi/dimens.xml (320x480 and nearer resolution)
res/values-hdpi/dimens.xml (480x800, 540x960 and nearer resolution)
res/values-xhdpi/dimens.xml (720x1280 - Samsung S3, Micromax Canvas HD, etc)
res/values-xxhdpi/dimens.xml (1080x1920 - Samsung S4, HTC one, etc)
res/values-large/dimens.xml (480x800)
-
res/values-large-mdpi/dimens.xml (600x1024)
res/values-sw600dp/dimens.xml (600x1024)
res/values-sw720dp/dimens.xml (800x1280)
res/values-xlarge-xhdpi/dimens.xml (2560x1600 - Nexus 10")
res/values-large-xhdpi/dimens.xml (1200x1920 - Nexus 7"(latest))
w600 says if width of current orientation is nearby 600
sq600 says if smallest with of device is nearby 600
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With