code: static DisplayMetrics getDisplayMetrics(final Context context) {
      final WindowManager
          windowManager =
          (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
      final DisplayMetrics metrics = new DisplayMetrics();
      windowManager.getDefaultDisplay().getMetrics(metrics);
      return metrics;
    }
docs: Returns a valid DisplayMetrics object
  
  @param context valid context
  @return DisplayMetrics object