You may query the
intrinsic zoom ratio of all cameras by using
CameraProvider.getAvailableCameraInfos, then obtain the
camera selector corresponding to the wide-angle (the one that has intrinsic zoom ratio smaller than 1.0)
CameraSelector wideAngleCameraSelector = null;
List<CameraInfo> allCameraInfos = cameraProvider.getAvailableCameraInfos();
for (CameraInfo cameraInfo : allCameraInfos) {
float ratio = cameraInfo.getIntrinsicZoomRatio();
if (ratio < 1) {
wideAngleCameraSelector = cameraInfo.getCameraSelector();
break;
}
}
if (wideAngleCameraSelector != null) {
cameraProvider.bindToLifecycle(lifecycleOwner, wideAngleCameraSelector, useCase);