I need to find my app running in 7 inches tab or 10 inches tab.How i can find it.please can any one help me.
Thanking in Advance.
I need to find my app running in 7 inches tab or 10 inches tab.How i can find it.please can any one help me.
Thanking in Advance.
Create a bool value in the values - sw600 and sw 720 as
in sw600 isSevenInch - true; isTenInch - false;
in sw720 isTenInch - true; isSevenInch - false;
and at runtime get the bool value and u can find that u required.
From Source
once try this
Display deviceDisplay = getWindowManager().getDefaultDisplay();
int width = deviceDisplay.getWidth();
int height = deviceDisplay.getHeight();
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
double xPoints = Math.pow(dm.widthPixels/dm.xdpi,2);
double yPoints = Math.pow(dm.heightPixels/dm.ydpi,2);
double deviceScreenSizeInInch = Math.sqrt(xPoints+yPoints);