DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
Log.e(TAG, "displayMetrics.widthPixels = "+(displayMetrics.widthPixels)+", displayMetrics.heightPixels = "+(displayMetrics.heightPixels) );