I’m trying to create a Compose app that will displ...
# compose
p
I’m trying to create a Compose app that will display a camera preview and, when a button is tapped, it will take a photo and pass it for further analysis. What I have now is an app that correctly displays the preview continuously, but I can only take a photo once - the next one results in
Not bound to a valid Camera
. Looks like I don’t correctly bind the use cases to the camera, but I’m struggling because the context is not available everywhere. I’ve found this example: https://developer.android.com/codelabs/camerax-getting-started#1 but it doesn’t use Compose. Are you aware of any Compose-based example that uses the preview and further photo processing?
1
partially resolved using https://betterprogramming.pub/build-a-camera-android-app-in-jetpack-compose-using-camerax-4d5dfbfbe8ec - now after two photos taken, no further analysis happens
I checked the logs, I was getting
Too many acquire images. Close image to be able to process next.
(code) so I needed to call
.close()
on the object from the callback
override fun onCaptureSuccess(image: ImageProxy) {