therefore, I wrote the following method in my work:
private void setDisplayMetrics(){ DisplayMetrics metrics = this.getResources().getDisplayMetrics(); int dh = metrics.heightPixels; int dw = metrics.widthPixels; if(dw < dh){ deviceWidth = dw; deviceHeight = dh; }else{ deviceWidth = dh; deviceHeight = dw; } System.err.println("--------------> dh : "+deviceHeight+" | dw "+deviceWidth); }
And it works great in the sense that it gives me the full width and height of the screen with great accuracy and reliability (which is exactly what I requested).
Here is the problem. On older Android devices, the screen sizes are the same as the sizes that the application can take, and the above script helps me set the size of the elements in the application. BUT with Android ICS I have this graphic button bar at the bottom of the screen, and it messed up my strategy.

I would very much like that at the same moment it would be possible to get the available application sizes for a portrait view, as well as a landscape view. And these dimensions must be accurate, regardless of the presence of the strip depicted above.
Does anyone know how to achieve this?
source share