Android screen resolution

限于喜欢 提交于 2019-12-20 10:58:06

问题


There are some screen resolutions already defined in Android. They are:

  • QVGA (240×320, low density, small screen)
  • WQVGA (240×400, low density, normal screen)
  • FWQVGA (240×432, low density, normal screen)
  • HVGA (320×480, medium density, normal screen)
  • WVGA800 (480×800, high density, normal screen)
  • WVGA854 (480×854 high density, normal screen)

How do I know which type my device screen resolution is?


回答1:


Use DisplayMetrics to get screen info from your device.

Sample code:

DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);

final int height = dm.heightPixels;
final int width = dm.widthPixels;



回答2:


Have you tried to search the specifications of your device? i.e. from Wikipedia's Nexus One article, you can find Nexus one screen resolution:

Display 480 x 800 px (PenTile RGBG), 3.7 in (94 mm), 254 ppi, 3:5 aspect ratio, WVGA, 24-bit color AMOLED with 100,000:1 contrast ratio and 1 ms response rate

That's a starting point...



来源:https://stackoverflow.com/questions/4666776/android-screen-resolution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!