The following code returns the screen size:
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
I'm using RelativeLayout to arrange components inside. For some reason when I divide width between components (say width*30/100
and width*70/100
) I get some screen space left out. And also about the height how can I get height of status bar and title bar does it vary among phones?
this would help you. It states the difference in the sizes of status bar.