Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the generalized screen size?

Tags:

android

http://developer.android.com/guide/practices/screens_support.html states:

Terms and concepts

Screen size Actual physical size, measured as the screen's diagonal. For simplicity, Android groups all actual screen sizes into four generalized sizes: small, normal, large, and extra large.

How do I programmatically get the generalized size of the device screen? The method or property I am looking for will return one of: small, normal, large, and extra large. (or const/enums that can be mapped to those)

Thanks.

-mz

like image 573
mahboudz Avatar asked May 13 '11 22:05

mahboudz


1 Answers

Use screenLayout in the Configuration object.

like image 72
CommonsWare Avatar answered Nov 03 '22 01:11

CommonsWare