I have a website that needs to distinguish between mobile phones, tablets, and ordinary laptops. Normally I could use an asp.net function to tell, but the complication is that I want tablets to be treated as NOT being mobile devices. Any device with a screen diagonal greater than 7.5 inches would get the normal website, and any device with a screen dialog of less than this would get the mobile version of the site.
First I thought all I need to do is get the screen.width (I'm using JavaScript) and screen.height, apply the pythagorean theorem to get the length of the diagonal (in pixels) and then divide by pixels-per-inch. The issue is this: Is "pixels-per-inch" always 96 for every type of device? If not, I can't do this.
Thanks.