How to Determine Android Screen Size Width and Height

stacktips avtar

The following code snippet shows how to determine the screen size dimensions in width and height of the Android device your application is running on.

Display display = mActivity.getWindowManager().getDefaultDisplay();
Point size = new Point();
int width = size.x;
int height = size.y;

Log.e("Width : " + width);
Log.e("Height : " + height);

Sharing is caring!

Did you like what Editorial wrote? Thank them for their work by sharing it on social media.

Related articles