I want to get the size of the screen, I already have the resolution
DisplayMetrics displayMetrics = new DisplayMetrics();
WindowManager windowmanager = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
windowmanager.getDefaultDisplay().getMetrics(displayMetrics);
final int deviceWidth = displayMetrics.widthPixels;
final int deviceHeight = displayMetrics.heightPixels;
but I want the size in inches, like the Samsung Galaxy S7 has a resolution of 2560x1440 and a screen of 5.1" , it's the 5.1 I want to get.
Thanks