code: private static Point getScreenSize(Context context, Point p) {
          if (p == null) {
              p = new Point();
          }
          WindowManager windowManager = (WindowManager) context
                  .getSystemService(Context.WINDOW_SERVICE);
          Display display = windowManager.getDefaultDisplay();
          display.getSize(p);
          return p;
      }
docs: Returns screen height and width
  
  @param context
  Any non-null Android Context
  @param p
  Optional Point to reuse. If null, a new Point will be created.
  @return .x is screen width; .y is screen height.