I am pretty much confused right now. I tried making different images and put them in appropriate folder(xhdpi,ldpi) but my app is not working for every device type from 2.7" to 10". So I decided to make different layouts for different screen sizes. I am getting device size in inches from this code-
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
double x = Math.pow(dm.widthPixels/dm.xdpi,2);
double y = Math.pow(dm.heightPixels/dm.ydpi,2);
double screenInches = Math.sqrt(x+y);
Log.d("debug","Screen inches : " + screenInches);
Now all I want that is if the device size is of around lets say 2.7" my app start using layouts from custom folder. Is that possible?