Android screen resolution

user430926 picture user430926 · Jan 12, 2011 · Viewed 38.3k times · Source

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?

Answer

Wroclai picture Wroclai · Jan 12, 2011

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;