Surface View, Front Camera Issue

Hello, I’m trying to show a live preview of the front camera using Surface View component.
I think it has some problem or maybe I’m doing something wrong.

There is no problem to show back camera’s live preview but when to try to show front camera preview, it shows only back screen. I tried everything.

Same issue in Companion and exported APK.
Both companion and APK have all the permission accepted.

I used two different phones and the issue was still there on both of the phones.
1st phone - Xiaomi Redmi Note 7 PRO (Android 9)
2nd phone - Samsung Galaxy Grand 2 (Android 7) (Custom ROM - RR) (Rooted)

APK: test.apk (4.8 MB)
AIA: test.aia (2.0 KB)

Blocks:
image

I will try to check your aia, then i will try to fix that

1 Like

Add Start Preview to button 1

bild

/Boban

3 Likes

Yeah, sorry. I forget to add that block but the problem is still there. I completely changed the block but still black screen.

(AIA, APK & Blocks’s SS has been updated)

Strange as it worked on my device, Samsung Note 8, Android 9.

/Boban

1 Like

Also Not Working in Galaxy J7 Core , Android 9,

it only works when i pause and resume my app, like while using open another thing and when i resume my app, it shows front camera on, but dont turn on front cam flash, getting error “set Parameters Failed”

It is really strange, It works on some devices and it does not work on “some devices”

It was working well 2-3 months ago but there is some problem with it, now.
It is a bug than

i also facing same problem, please if you can help

1 Like

Unfortunately, I couldn’t find a solution, neither anyone told me yet. I don’t understand what is the issue but there is an “issue” for sure.

When I made my fun Tools I had the same problem. I solved it with following procedure:Switch from portrait to landscape and back.

1 Like

It says when using the Front Camera, “Cannot find camera service” or something close to it.