Android get screen width and height

DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float displayHeight = displayMetrics.heightPixels / displayMetrics.density;
float displayWidth = displayMetrics.widthPixels / displayMetrics.density;
Log.d("Display Height", displayHeight +"");
Log.d("Display Width", displayWidth +"");
Content Protection by DMCA.com
Please Share