Get screen resolution

The following code is to obtain screen resolution, through WindowManager.