code: public static int convertToDIP(int pixels) {
         return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, pixels,
                  Resources.getSystem().getDisplayMetrics()));
      }
docs: Returns a density independent pixel value rounded to the nearest integer
  for the desired dimension.
  
  @param pixels The pixel value to be converted
  @return A rounded DIP value