Skip to main content
Participant
October 31, 2023

Adobe Aero, Zebra ET40 ET45 10 inch Android 13  ( SPR 51772 reference )  Camera orientation

  • October 31, 2023
  • 0 replies
  • 62 views

When using Adobe Aero, Zebra ET40 ET45 10 inch Android 13  ( SPR 51772 reference )  Camera orientation

The orientation of the camera scanner preview is different from the orientation of device, which cause the wrong preview orientation

Camera scanner orientation of ET45 is 270 degree,  this is atypical for Tablet device

But using Camera1 API there an method to accommodate for this in customers application

 

The solution below is the method from Zebra to fix the issue. It has to be added to the API.  Is this something Adobe Aero has to do or is there a way for me to add this code into Adobe Aero? 

 

Solution:

The customer app use the camera API 1 should add logic to correct the preview orientation:

public void setDisplayOrientation(Activity activity, Camera.CameraInfo cameraInfo ) {
if(activity == null || mCamera == null || cameraInfo == null)
{ return; }
int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();
int degrees = 0;
switch (rotation)
{ case Surface.ROTATION_0: degrees = 0; break; case Surface.ROTATION_90: degrees = 90; break; case Surface.ROTATION_180: degrees = 180; break; case Surface.ROTATION_270: degrees = 270; break; }
int result;
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
{ result = (cameraInfo.orientation + degrees) % 360; result = (360 - result) % 360; // compensate the mirror }
else
{ // back-facing result = (cameraInfo.orientation - degrees + 360) % 360; }
try
{ mCamera.setDisplayOrientation(result); }
catch (Exception e)
{ Log.e(TAG, "setDisplayOrientation", e); }
}

 

--