- Home /
Detect physical resolution for showing SD or HD
We have our sprites in both SD and HD. We want to offer HD for tablets with high resolution (both iPad Retina and good Android tablets). We can't use only the width in px of the screen since some Android phone (Samsung S5...) have high resolution in px, even if they are barely 5 inches of width.
So, how could we know when we're on a tablet (physically wide) or on a phone (small)?
I guess on higher resolution u must use HD sprites, no matter phone or tablet it is :) And u can get physical wide only with ruler :) Try to read DPI and multiply it with resolution :)
While logical resolution (num of pixels) should be easy enough to find from the screen class: http://docs.unity3d.com/ScriptReference/Screen.html
However the PHYSICAL resolution, is indeed as Chariot said, based upon the DPI. This is why the same image looks better on a small screen than a large screen, when they have the same number of pixels.
While the System Info class (http://docs.unity3d.com/ScriptReference/SystemInfo.html) can help narrow this down with DevceType(tablet/phone/pc): If this is not sufficient, I suspect you will need use systemInfo to get the model the device, and look up it's physical size (in inches or cm) in your own table.
Your answer
Follow this Question
Related Questions
How to obtain physical screen size in iOS simulator? 0 Answers
Is there a way to determine Android physical screen size? 5 Answers
Get Current Screen Window is Positioned In, Get Dpi of That Screen 1 Answer
Screen.dpi for in-editor 4 Answers
Implementation of a calculator with a given object(calculator) 1 Answer