Hi everyone,
after simple changing android:targetSdkVersion in manifest from 22 to 30 i don't have more request to enable camera access so i need to enable manually access to camera in appa setting.
There are several versioned components that affect the compilation process and the runtime behavior of our apps. The purpose of this tutorial is to explain the differences between them and help you choose which version to use. Each Android version is mapped to an api level. You can see this...
www.b4x.com
You are also not adding the right Permission in the manifest.
Subname: Addpermission Note: This is not really an Sub. It´s more an overview of permissions available Description: A list of all permissions usable in Android (B4A). Every permission is one line of the following list. To use this permission in your app you need to add the line you need in the...
www.b4x.com
B4X:
' Required to be able to access the camera device.
AddPermission(android.permission.RECORD_AUDIO) ' Allows an application to record audio.
Example based on B4XPages: https://www.b4x.com/android/forum/threads/b4x-b4xpages-barcode-reader.120417/#content CameraEx class wraps the Camera object and using reflection and other code it extends its functionality. CameraEx class requires Android 2.3+ and depends on Camera library v2.20+...
B4A + B4i barcode reader. Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Depends on BCToast: https://www.b4x.com/android/forum/threads/b4x-bctoast-cross-platform-custom-toast-message.111046/#content (BCToast will be an internal library in the near future) While the...
Probably you did not report some words, but also with those permissions ther is not camera rights request
-> AddPermission(android.permission.CAMERA) ' Required to be able to access the camera device. <-
AddPermission(android.permission.CAPTURE_AUDIO_OUTPUT) ' Allows an application to capture audio output.
My manifest is based on QRCodeReaderView and if in manifest i write <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="22"/> during first app start i have camera permission request
Maybe I missed a few pieces or I didn't explain myself. I need to read qr code.
For doing what i need, i use the 'a SEVEN YEARS old Library' that works perfectly but if if in manifest i write <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="30"/> the first time i use app there is not request of camera permission. If i change 30 in 22 i receive camera permission resquest.
All clear?
CameraEX example works but is not a qrreader, is a simple camera picture maker.
Now the example used in the QRCodeReaderView library will not work if you targeting recent android sdk.
Download that example and change the following:
1- Check the library Runtimepermission in library tab
2- change the code of b1_Click event to:
B4X:
Sub b1_Click
Dim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
qrcrv.Visible = True
DoEvents
qrcrv.startScan
End If
End Sub
Then the example will work, so reflect the changes in your app.