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);
Tagged in : #Android


Please note: We reserve the right to delete comments that contains snarky remarks, offensive or off-topic. To know more read our comments policy.