Android camera qt6
-
Hello,
I'm trying to build use camera on android but I have access authorization problems :
E libc : Access denied finding property "camera.hal1.packagelist"
I FeatureParser: can't find capricorn.xml in assets/device_features/,it may be in /system/etc/device_features
E libc : Access denied finding property "camera.hal1.packagelist"
E libc : Access denied finding property "camera.hal1.packagelist"
W System.err: java.lang.RuntimeException: setParameters failed
W System.err: at android.hardware.Camera.native_setParameters(Native Method)
W System.err: at android.hardware.Camera.setParameters(Camera.java:2098)
W System.err: java.lang.RuntimeException: setParameters failed
W System.err: at android.hardware.Camera.native_setParameters(Native Method)
W System.err: at android.hardware.Camera.setParameters(Camera.java:2098)Same problems with declarative camera example or with minimal example.
This app works well on IOS but camera access seems to be denied despite the android.permission.camera in android manifest.
Have you any idea to get the access ?
Link to the bug ticket : https://bugreports.qt.io/browse/QTBUG-101391
-
Hello,
I'm trying to build use camera on android but I have access authorization problems :
E libc : Access denied finding property "camera.hal1.packagelist"
I FeatureParser: can't find capricorn.xml in assets/device_features/,it may be in /system/etc/device_features
E libc : Access denied finding property "camera.hal1.packagelist"
E libc : Access denied finding property "camera.hal1.packagelist"
W System.err: java.lang.RuntimeException: setParameters failed
W System.err: at android.hardware.Camera.native_setParameters(Native Method)
W System.err: at android.hardware.Camera.setParameters(Camera.java:2098)
W System.err: java.lang.RuntimeException: setParameters failed
W System.err: at android.hardware.Camera.native_setParameters(Native Method)
W System.err: at android.hardware.Camera.setParameters(Camera.java:2098)Same problems with declarative camera example or with minimal example.
This app works well on IOS but camera access seems to be denied despite the android.permission.camera in android manifest.
Have you any idea to get the access ?
Link to the bug ticket : https://bugreports.qt.io/browse/QTBUG-101391
@Lilde having the permission only on the manifest is no longer enough, on modern android devices,
you have to request permission before usage, so that the user gets a popup and can opt out of your app using the camera.
The QtAndroid namespace has a special set of functions you can use, just for this:
https://doc.qt.io/qt-5/qtandroid.html#requestPermissions
and
https://doc.qt.io/qt-5/qtandroid.html#requestPermissionsSync -
Ok, thanks you. I try with this function.
EDIT : Hum, This function is for Qt5, have you the way to do it in Qt6 ?@Lilde seems now to be here:
https://doc.qt.io/qt-6/qtandroidprivate.html