public boolean isTabletDevice() {
TelephonyManager telephony = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
int type = telephony.getPhoneType();
if (type == TelephonyManager.PHONE_TYPE_NONE) {
Log.i("is Tablet!");
} else {
Log.i("is phone!");
}
return false;
}
http://www.cnblogs.com/coding-way/archive/2012/04/23/2466412.html
/**
* 判断当前设备是手机还是平板,代码来自 Google I/O App for Android
* @param context
* @return 平板返回 True,手机返回 False
*/
public static boolean isTablet(Context context) {
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
http://www.cnblogs.com/sunzn/p/3663363.html