Open jackeykabra opened 6 years ago
How did you initialize FA?
Those 2 activities have different default configurations that your device might not support.
// This is for Kt:
CameraConfiguration(
previewResolution = firstAvailable(
wideRatio(highestResolution()),
standardRatio(highestResolution())
),
previewFpsRange = highestFps(),
flashMode = off(),
focusMode = firstAvailable(
continuousFocusPicture(),
autoFocus()
),
frameProcessor = {
// Do something with the preview frame
}
)
// This is for java:
CameraConfiguration
.builder()
.photoResolution(standardRatio(
highestResolution()
))
.focusMode(firstAvailable(
continuousFocusPicture(),
autoFocus(),
fixed()
))
.flash(firstAvailable(
autoRedEye(),
autoFlash(),
torch(),
off()
))
.previewFpsRange(highestFps())
.sensorSensitivity(highestSensorSensitivity())
.frameProcessor(new SampleFrameProcessor())
.build();
I haven't any changed in exiting MainActivity.kt file again I checked after you posted a comment but the still same problem that device as I mentioned as above comment.
Initialize FA:
// This is for Kt:
private sealed class Camera(
val lensPosition: LensPositionSelector,
val configuration: CameraConfiguration
) {
object Back : Camera(
lensPosition = back(),
configuration = CameraConfiguration(
previewResolution = firstAvailable(
wideRatio(highestResolution()),
standardRatio(highestResolution())
),
previewFpsRange = highestFps(),
flashMode = off(),
focusMode = firstAvailable(
continuousFocusPicture(),
autoFocus()
),
frameProcessor = {
// Do something with the preview frame
}
)
)
object Front : Camera(
lensPosition = front(),
configuration = CameraConfiguration(
previewResolution = firstAvailable(
wideRatio(highestResolution()),
standardRatio(highestResolution())
),
previewFpsRange = highestFps(),
flashMode = off(),
focusMode = firstAvailable(
fixed(),
autoFocus()
)
)
)
}
ActivityJava file: it works perfectly in the SM-T231 device.
MainActivity.kt file: A camera does not display in the SM-T231 device version is 4.4.2 only blank screen is displaying.
When we click on capture button image is display in image view but an orientation problem occurs in this device. I have no change on your existing library code.
I have checked two more device it will worked perfectly. the device is Moto g4 plus and HTC One M9PLUS.
Can you please solve it. Thank you