title: how to get sensor size for api below 21?
body: <p>How to get sensor size of camera for API level below 21? We can use size F but it is for API level 21 and above. I have used size F in my code but it is not working for all the devices I have used the following code. </p>
  
  <pre><code> private SizeF getCameraResolution(int camNum) {
      SizeF size = new SizeF(0,0);
      CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
      try {
          String[] cameraIds = manager.getCameraIdList();
          if (cameraIds.length &gt; camNum) {
              CameraCharacteristics character = manager.getCameraCharacteristics(cameraIds[camNum]);
              size =character.get(CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE);
  
          }
      }
      catch (CameraAccessException e)
      {
          Log.e("YourLogString", e.getMessage(), e);
      }
      return size;
  }
  </code></pre>