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


Here we get result in pixel.





Replied on September 15, 2015
Thanks.

Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us