I\'m really confused as to how iOS Ruler apps currently on the market are compatible with different size devices. An example is shown at the bottom.
After researchin
As you have discovered, iOS has no public API for getting the device's PPI.
These apps probably have a hardcoded list, as you speculated. There are under a hundred hardware device ids (see this list for example), and only a handful of different PPIs:
I'd guess the makers of these apps don't usually test their apps with every device. And unless you've checked the apps, there's no reason you should believe the apps are more accurate than the PPIs listed above.
To detect the iOS device type, check the answers to this question.