Android Question Intent based camera example and SDK 34

asales

Expert
Licensed User
Longtime User
I'm tried to run this example with target = SDK 34 and B4A 13, but I get this error message:
B4X:
keeprunningservice$ResumableSub_Startresume (java line: 197)
java.lang.SecurityException: Starting FGS with type camera callerApp=ProcessRecord{3cdb7e 13380:b4a.example.cameraintent/u0a191} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_CAMERA] any of the permissions allOf=false [android.permission.CAMERA, android.permission.SYSTEM_CAMERA]  and the app must be in the eligible state/exemptions to access the foreground only permission
I put this lines in the manifest:
B4X:
AddPermission(android.permission.FOREGROUND_SERVICE_CAMERA)
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.SYSTEM_CAMERA)
SetServiceAttribute(KeepRunningService, android:foregroundServiceType, "camera")

What am I doing wrong?
Thanks in advance for any tip.
 

walterf25

Expert
Licensed User
Longtime User
I'm tried to run this example with target = SDK 34 and B4A 13, but I get this error message:
B4X:
keeprunningservice$ResumableSub_Startresume (java line: 197)
java.lang.SecurityException: Starting FGS with type camera callerApp=ProcessRecord{3cdb7e 13380:b4a.example.cameraintent/u0a191} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_CAMERA] any of the permissions allOf=false [android.permission.CAMERA, android.permission.SYSTEM_CAMERA]  and the app must be in the eligible state/exemptions to access the foreground only permission
I put this lines in the manifest:
B4X:
AddPermission(android.permission.FOREGROUND_SERVICE_CAMERA)
AddPermission(android.permission.CAMERA)
AddPermission(android.permission.SYSTEM_CAMERA)
SetServiceAttribute(KeepRunningService, android:foregroundServiceType, "camera")

What am I doing wrong?
Thanks in advance for any tip.
Take a look at this tutorial here https://www.b4x.com/android/forum/threads/android-14-targetsdkversion-34-and-services.162140/
might help solve the issue.
 
Upvote 0
Top