Android get screen width and height programmatically

Asked on September 15, 2015
In my android application I need to get device screen width and height programmatically.
Any Help?

Replied on September 15, 2015
Display display = activity.getWindowManager().getDefaultDisplay();
Point size = new Point();
int screenWidth = size.x;
int screenHeight = size.y;

Here we get result in pixel.

Replied on September 15, 2015

Write Answer

©2024 | Privacy Policy | Contact Us