Reputation: 2812
I understand DPI/PPI and pixels won't really give the real physical size of the screen, and only info like Extended Display Identification Data (EDID) could give real physical size of the screen. I suspect the smart phones or tablets have such info embedded somewhere. If so, do the operating system like Android or iOS could access such info, thus the APIs could reveal the size in inch or CM?
And then how to get the size through Xamarin C# or JAVA or Swift?
My application is to display a shape in exact physical size on mobile/tablet screens, for example, a ruler.
Upvotes: 1
Views: 309
Reputation: 17422
To get iOS screen size call this method
var screenSize=UIScreen.MainScreen.Bounds;
For android devices use below code
var metrics = Resources.DisplayMetrics;
Upvotes: 0