List of utility methods to do Device Type Check
String | getPhoneModel() get Phone Model return android.os.Build.MODEL;
|
boolean | isGoogleTV(final Context context) Used to determine if the current device is a Google TV return context.getPackageManager().hasSystemFeature( "com.google.android.tv"); |
boolean | isTablet(Context context) is Tablet Configuration configuration = context.getResources()
.getConfiguration();
return (configuration.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
|
boolean | isTablet(Context ctx) Method that returns if the device is a tablet Configuration configuration = ctx.getResources().getConfiguration();
return (configuration.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
|
boolean | isTablet(final Context context) Used to determine if the device is a tablet or not return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
|
String | getDeviceName() get Device Name String manufacturer = Build.MANUFACTURER; String model = Build.MODEL; if (model.startsWith(manufacturer)) { return capitalize(model); } else { return capitalize(manufacturer) + " " + model; |
String | getPhoneModel() get Phone Model return android.os.Build.MODEL == null ? "Unknown" : android.os.Build.MODEL; |
String | convertPhoneType(int type) convert Phone Type switch (type) { case TelephonyManager.PHONE_TYPE_NONE: return "NONE"; case TelephonyManager.PHONE_TYPE_GSM: return "GSM"; case TelephonyManager.PHONE_TYPE_CDMA: return "CDMA"; case TelephonyManager.PHONE_TYPE_SIP: ... |
String | getDeviceType(Activity act) get Device Type return getDeviceType(act.getApplicationContext());
|