Start a Project

How to get the screen width and height in android

In this small blog,
We will show you the simple methods to get your screen width and height in pixels as well as in dp.

Screen width or height in pixels

If you have used this method in an Activity,

If you’re not in an Activity you can get the default Display via WINDOW_SERVICE

 

Screen width or height in dp

 

 

 

 

Exit mobile version