I tried to use following code to get screen width and height in android app development:
Display display = getWindowManager().getDefaultDisplay();
int scree
Try with the following code to get width and height of screen
int widthOfscreen =0;
int heightOfScreen = 0;
DisplayMetrics dm = new DisplayMetrics();
try {
((Activity) context).getWindowManager().getDefaultDisplay()
.getMetrics(dm);
} catch (Exception ex) {
}
widthOfscreen = dm.widthPixels;
heightOfScreen = dm.heightPixels;