The below snippet helps to find the screen catogory
public void getScreenSize()
{
switch (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
{
case Configuration.SCREENLAYOUT_SIZE_SMALL:
Toast.makeText(Home.this, "SMALL SCREEN", Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_LARGE:
Toast.makeText(Home.this, "LARGE SCREEN", Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_XLARGE:
Toast.makeText(Home.this, "XLARGE SCREEN", Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_NORMAL:
Toast.makeText(Home.this, "NORMAL SCREEN", Toast.LENGTH_LONG).show();
break;
}
public void getScreenSize()
{
switch (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
{
case Configuration.SCREENLAYOUT_SIZE_SMALL:
Toast.makeText(Home.this, "SMALL SCREEN", Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_LARGE:
Toast.makeText(Home.this, "LARGE SCREEN", Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_XLARGE:
Toast.makeText(Home.this, "XLARGE SCREEN", Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_NORMAL:
Toast.makeText(Home.this, "NORMAL SCREEN", Toast.LENGTH_LONG).show();
break;
}