-- advertisement --

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);