Android Question CameraEx and new SDK 34

pliroforikos

Active Member
Licensed User
Hello,
I'm using a edited copy of bellow example in order to scan QRcodes with my app.
https://www.b4x.com/android/forum/threads/b4x-b4xpages-barcode-reader.120417/page-2#posts

Today as i was reading google console i saw an error about camera.

As i can see is the new politics in ver 34, and as explained here i put
B4X:
AddPermission(android.permission.FOREGROUND_SERVICE_CAMERA)

in manifest.

I wonder if you guys has same problem and if everything is allright now or i need something else to do.
Thanks for any help
 

drgottjr

Expert
Licensed User
Longtime User
you need the permission + the foreground service type + google's approval when submitting to play

B4X:
AddPermission(android.permission.FOREGROUND_SERVICE_CAMERA)
SetServiceAttribute(service_name, android:foregroundServiceType, "camera")

plus you should probably add:
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />

plus be ready in case google complains about leaving the camera on all the time, constantly focussing and searching for qr codes
 
Last edited:
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
google says your app has a foreground service. how can you not know its name?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…