How to get screen dimensions as pixels in Android?

Posted by Rohit Kumar | Updated on | Android

If you want get screen dimensions as pixels in Android? Use the following code, you can get the runtime display’s width & height:

If the device has a navigation bar, then count its height:

So the final height of the device is:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers