code: public static Point getSize(Resources res, int resId) {
          BitmapFactory.Options options = new BitmapFactory.Options();
          options.inJustDecodeBounds = true;
          BitmapFactory.decodeResource(res, resId, options);
          int width = options.outWidth;
          int height = options.outHeight;
          return new Point(width, height);
      }
docs: Get width and height of the bitmap specified with the resource id.
  @param res resource accessor.
  @param resId the resource id of the drawable.
  @return the drawable bitmap size.