As I understand, the matching dpi and size qualifiers for the device are based not on actual screen properties (physical dpi and size), but instead on what was predefined by
Take a look at this page : Wikipedia : List of displays by pixel density
AFAIK, most of the time, dpi and ppi are the same, and it next generalized to HDPI/MDPI/LDPI ( see Android screen ranges ). There are just a very little number of exceptions.
I've found this to be helpful as it is specific to Android: http://en.wikipedia.org/wiki/Comparison_of_Android_devices
Here is a list of devices with their respective DIP buckets. It's far from official or complete, but it's the largest source I have found so far:
http://blog.blundell-apps.com/list-of-android-devices-with-pixel-density-buckets/
Thanks to @Blundell for listing it in the comments.
Since latest I/O 2015 here is the list that you can use https://www.google.com/design/tool/devices/
The size data comes from Wikipedia, and for a better understanding of Pixel Density, check out this great post by Teehan+Lax.
Screen Sizes
I found this answer on Android Developers.