Open commjoen opened 8 years ago
Agreed. The Camera2 API also has some nice features, for example being able to use different resolutions for the preview and for decoding. We'll still have to support the old API for pre-lollipop devices though.
It's been a while since this was mentioned. Are there any plans for this in the near future?
@mattfiocca No plans yet, since the current camera implementation works well, and migration to the Camera2 API risks introducing new issues on various devices.
That said, pull requests are welcome.
@rkistner, roger that. Camera2 api has been a pain in my side on other projects... i get it ;)
+1 it would be nice to switch to camera2 / camerax
@mattfiocca No plans yet, since the current camera implementation works well, and migration to the Camera2 API risks introducing new issues on various devices.
That said, pull requests are welcome.
This lib is not working well in my device, which is run on Android 9 and only support Camera 2 API.
CameraInstance: Failed to configure camera
java.lang.RuntimeException: Camera not open
at com.journeyapps.barcodescanner.camera.CameraManager.configure(CameraManager.java:157)
at com.journeyapps.barcodescanner.camera.CameraInstance$4.run(CameraInstance.java:203)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
@seasonyuu Which phone is this? Does the Barcode Scanner app work on your device?
While the original Camera API has been deprecated for a while, I'm not aware of it being removed/disabled anywhere. Android 9 did add other restrictions, such as not allowing apps to use the camera while in the background.
@seasonyuu Which phone is this? Does the Barcode Scanner app work on your device?
While the original Camera API has been deprecated for a while, I'm not aware of it being removed/disabled anywhere. Android 9 did add other restrictions, such as not allowing apps to use the camera while in the background.
That's not a phone, somehow is an speaker which is running on Android 9. And maybe the firmware didn't implement Camera legacy API.
Like @seasonyuu I get the CameraInstance: Failed to configure camera
error, when implementing the ContinuousScanActivity and trying to run it on the Nexus 5X virtual device on API 28 (Android 9.0). I am using zxing-android-embedded:4.1.0
Is there a way, I could use camera2? Or do I need to manually add permissions? I am a bit confused on what to do.
@artofbeinghuman It's very rare to see a device not implement the camera 1 API. Migrating to the camera2 API would be for the improved API capabilities, not for device compatibility.
In your case my guess is that it's just an emulator configuration issue. Check that the camera is enabled in the emulator, and that other apps (such as the Barcode Scanner app) works.
The Camera API is currently deprecated. It would be great if we can move to the Camera2 API.