There are circumstances where it's nice to know if you are running on a retina display or not.
For example, GUI code that distinguishes between taps and drags. There is typically a threshold, and if the touch moves beyond that threshold, the touch turns into a drag. If the threshold is too small, then it becomes difficult to tap the object- the slightest move turns into a drag. Too high and the start of the drag is delayed and feels abrupt.
This works on Android and iOS. iPhone Retina displays have 320 ppi, iPad 3 has 260 ppi. dpi = ppi, ppi (pixels per inch) is Apple-speak, dpi (dots per inch) is Android speak. IMHO, ppi makes a little more sense because on screens we have pixels and not dots as in print
I assume this class will get updated as new devices get released. If, for any reason, a future device had multiple resolutions, you could use this with Screen.currentResolution, iPhoneSettings.model, and/or the hardware specs to try to pin down the pixel density.
It’s a hack, but i just get the worldtoscreen coordinates of the bounds of a known box collider, and just use the values (which will vary based on pixel density) as a variable.