I am trying to check if my android is tablet or not by detecting if it has speakerphone. please help.
public boolean isTablet(Context context) {
boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE);
boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
return (xlarge || large);}
In samsung SGH I527M phone the method return true and its not a tablet. As I mantioned I just wanted to see if the device has earphone to listen through.