开发者

List of densities for different android devices

开发者 https://www.devze.com 2023-04-07 22:17 出处:网络
Is there a list of density values for different android devices? I know how to check it programmatically but I this doesn\'t work if I don\'t have a specifi开发者_JS百科c device.As a general rule, if

Is there a list of density values for different android devices? I know how to check it programmatically but I this doesn't work if I don't have a specifi开发者_JS百科c device.


As a general rule, if you know the screen resolution of the device you can determine what density bucket it's going to fall into. This is because density is a function of resolution and physical size, and manufacturers tend to pick a screen size that fits the display resolution. As such, here is a list I use of all the common resolutions found on the market.

LDPI: QVGA (320x240), WQVGA (432x240)

MDPI: HVGA (480x320), WXGA (1280x800), SVGA (1024x600)

HDPI: WVGA (800x480), FWVGA (854x480)

The reason those two really high resolutions exist in MDPI is because they are only used on tablets, which have a larger screen size...so the dpi rating works out to still be in the midrange.

Also, you may find this information on Screen Sizes and Densities useful, from the Developer portal.

HTH!


use this code for it frnd: scale gives you density:

for low scale:0.75

for medium scale:1.0

for large scale:1.5

float scale; 
DisplayMetrics displaymetrics = new DisplayMetrics();                             
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);

scale =getApplicationContext().getResources().getDisplayMetrics().density;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号