static boolean isTablet (Context context) {
// TODO: This hacky stuff goes away when we allow users to target devices
int xlargeBit = 4; // Configuration.SCREENLAYOUT_SIZE_XLARGE; // upgrade to HC SDK to get this
Configuration config = context.getResources().getConfiguration();
return (config.screenLayout & xlargeBit) == xlargeBit;
}
http://stackoverflow.com/questions/9478793/how-to-know-its-phone-or-tablet
'프로그래밍 > Android' 카테고리의 다른 글
안드로이드 화면 해상도 얻기 (0) | 2013.07.05 |
---|---|
Google I/O 2013 - Volley: Easy, Fast Networking for Android (0) | 2013.06.11 |
페이스북 스타일 슬라이드 android-facebook-style-slide (1) | 2012.12.18 |