I tried to use following code to get screen width and height in android app development:
Display display = getWindowManager().getDefaultDisplay(); int scree
WindowManager w = getWindowManager(); Display d = w.getDefaultDisplay(); DisplayMetrics metrics = new DisplayMetrics(); d.getMetrics(metrics); Log.d("WIDTH: ", String.valueOf(d.getWidth())); Log.d("HEIGHT: ", String.valueOf(d.getHeight()));