If your issue is related to observed behavior, rather than API usage, please include information about the specific device (even if the device is an emulator).
Questions tagged [android-camerax]
512 questions
8
votes
0 answers
Firebase mlKit Barcode scanner mlKit with camera X not working on android Pie
I'm trying to scan QR code using Firebase ML kit but I cannot start camera on android Pie (Nokia 6.1 Plus). However, same code is working properly on Android Oreo Redmi 6 A
This is my gradle:
implementation…
![](../../users/profiles/11471256.webp)
Rishabh Rastogi
- 101
- 2
8
votes
3 answers
What is Android CameraX?
What is Android CameraX?
There is a session about CameraX planned in Google I/O 2019. What is it? Is it a new framework API? Is it a new library?
https://events.google.com/io/schedule/events/8d400240-f31f-4ac2-bfab-f8347ef3ab3e
Does it mean that…
![](../../users/profiles/2749406.webp)
Yuichi Araki
- 3,058
- 17
- 22
7
votes
4 answers
capture overlay using PreviewView of cameraX
I'm trying to capture a picture with overlay included in image capture. I was able to set overlay to previewView using cameraView.overlay.add(binding.textView). How ever, it did not save when trying to save an image with imageCapture Only the…
![](../../users/profiles/4250562.webp)
Abhi
- 213
- 2
- 21
7
votes
1 answer
CameraX: Capturing photo as bitmap
I am experimenting with Googles CameraX sample app (CameraXBasic, can be found on Github) and would like to capture the image as a Bitmap to be able to make some modifications to the image before saving it. Does anyone have a suggestion on how to…
![](../../users/profiles/13493715.webp)
MichaelK
- 73
- 1
- 6
7
votes
1 answer
Why FirebaseVisionImage.fromMediaImage() produces OutOfMemoryError
CameraX is build, analyze() method is called and an image is passed and then closed (deleted) with close() method. From this image FirebaseVisionImage is created and passed for processing (text recognition). Code samples and code labs differs and…
![](../../users/profiles/8390682.webp)
Sorel
- 81
- 4
7
votes
2 answers
Camerax run in service . How to get lifecycleowner or run without it inside a foreground service?
Use case : is that I have to run camera in background inside a service without any activity or fragment
Blocker : New camerax session is bind to lifecycleowner but the service don't have any .So how to get this object or run without it ?
Already…
![](../../users/profiles/4928318.webp)
ArpitA
- 505
- 4
- 14
7
votes
1 answer
How can I display a negative mode preview with CameraX in Android?
I'm learning CameraX API, and CameraXBasic is a office sample code.
CameraFragment.kt in CameraXBasic project displays a real camera preview.
Now I hope to display a negative mode preview. How can I do with CameraX API? Is there a sample…
![](../../users/profiles/828896.webp)
HelloCW
- 476
- 10
- 77
- 178
7
votes
3 answers
How to increase frame rate with Android CameraX ImageAnalysis?
I'm investigating the new CameraX API, in relation to how viable it might be to switch over from our current Camera2 system.
In our Camera2 system, we use an OpenGL surface to capture the frames from a PreviewCaptureSession, and we are hitting…
![](../../users/profiles/9829321.webp)
Iain Stanford
- 395
- 3
- 12
7
votes
2 answers
Tap to adjust focus / exposure in CameraX
I would like to implement the standard UX of tapping a point on the preview to adjust the auto-focus and auto-exposure points to the place where they tapped. I found the Preview.focus() function, however it says that it needs dimensions in the…
![](../../users/profiles/473201.webp)
phreakhead
- 13,409
- 4
- 36
- 36
7
votes
4 answers
How to set a correct aspect ratio using CameraX?
I'm following the CameraX codelab and I'm getting a wrong aspect ratio on the preview even using setTargetAspectRatio and setTargetResolution methods.
private fun startCamera() {
// Create configuration object for the viewfinder use case
val…
![](../../users/profiles/1094333.webp)
nglauber
- 2,430
- 17
- 22
7
votes
2 answers
java.lang.IllegalStateException: CameraX not initialized yet
Im following this Google Codelab about CameraX
And when I get to the part of adding a Camera preview, I do it like this:
val previewConfig = PreviewConfig.Builder().apply {
setTargetAspectRatio(Rational(1, 1))
…
![](../../users/profiles/4664987.webp)
Alfredo Bejarano
- 456
- 4
- 17
7
votes
4 answers
Android CameraX doesn't show anything
I've implemented a new sample, here is a link which describes new CameraX api from Google codelabs, but TextureView doesn't show anything and throw next exception:
OpenGLRenderer: [SurfaceTexture-0-7609-1] dequeueImage: SurfaceTexture is not…
![](../../users/profiles/2699863.webp)
Max
- 83
- 2
- 7
6
votes
4 answers
CameraX preview not working after upgrade
I've updated my gradle plugins for CameraX kotlin and all of a sudden I've got an error that I don't know how to fix.
This is my camera fragment
package com.khumomashapa.notes.fragments
import android.annotation.SuppressLint
import…
![](../../users/profiles/12474305.webp)
Khumo Mashapa
- 93
- 1
- 6
6
votes
4 answers
Android CameraX image rotated
I have followed Google CameraX code lab to implement custom camera. Camera preview is fine but when i take image after image capture image is rotated. I am taking image in portrait mode but saved image is in landscape. Here is the method to…
![](../../users/profiles/1849991.webp)
Nouman Bhatti
- 1,635
- 3
- 24
- 50
6
votes
1 answer
CameraX - Unable to configure Camera
I want to implement a custom View which will display a live preview using Camera X API but I'm stuck with the configuration of Camera X...
Based on the CameraX sample code, I try to implement my custom view but nothing but a black screen appears and…
![](../../users/profiles/10159898.webp)
Bruno
- 3,204
- 4
- 14
- 30