Read about the support of various screen sizes in Android (in Russian).
In short: you make different layouts, create resources with folders corresponding to different ranges of screen sizes values-large , values-small , etc. You can create your own ranges using screen size classifiers
For example, values-w<n>dp ( values-w720dp , values-w1024dp etc.) defines the minimum available screen width.
And place the links to the layouts in the folders corresponding to the resolution and use the same names corresponding to the names of the resources.
Well, screen sizes in inches are as follows:
DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); //метод Activity int width=dm.widthPixels; int height=dm.heightPixels; int dens=dm.densityDpi; double wi=(double)width/(double)dens; double hi=(double)height/(double)dens; double x = Math.pow(wi,2); double y = Math.pow(hi,2); double screenInches = Math.sqrt(x+y);