StackTips

How to Determine Android Screen Size Width and Height

stacktips avtar

Written by:

Editorial,  1 min read,  updated on September 17, 2023

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();
display.getSize(size);
int width = size.x;
int height = size.y;

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