Wednesday , September 19 2018
Home / Android / How to get screen width and height of device ?

How to get screen width and height of device ?

screen_size

If you want to get screen width and height of device in java file you can use DisplayMetrics class . This is a very simple way to get screen size. By using this code you can get size in pixels.

In a view you need to do something like this:

 

About admin

Check Also

Android Activity Launch Modes

Launch mode is an instruction for Android OS which specifies how the activity should be ...

Leave a Reply