Dpi.js let you retrieve mobile browsers DPI. Mobile phone have a great variety of size and dpi. Unfortunatly by default Javascript tell you your browser DPI is 96. This library give you the true DPI for Popular phones.
Usage :
#1 - include DPI.js
<script type="text/javascript" src='dpi.js'></script>#2 - Use it in your javascript :
Get your mobile browser DPI using : getDPI();
#[Apple]
- iphone EDGE : 163 DPI
- iPhone 3G : 163 DPI
- iPhone 3GS : 163 DPI
- iPhone 4 : 326 DPI
- iPhone 4S : 326 DPI
- iPad 1 : 132 DPI
- iPad 2 : 132 DPI
- iPad 3 : 264 DPI
- iPod Touch 1 : 163 DPI
- iPod Touch 2 : 163 DPI
- iPod Touch 3 : 163 DPI
- iPod Touch 4 : 326 DPI
#[HTC]
- HTC Sensation : 256 DPI
- HTC Incredible : 252 DPI
- HTC Vision : 252 DPI
- HTC Desire Build : 252 DPI
- HTC Pyramid : 256 DPI
- HTC Desire S : 252 DPI
- HTC Legend : 180 DPI
- HTC Desire HD : 217 DPI
- HTC Desire Z : 252 DPI
- HTC Wildfire : 125 DPI