Now the camera...
It's going to be a long week-end!
When I try to fetch the camera (and storage) permissions with this:
It fails with the camera (but works with the storage...)
I tried to change the order, same thing.
Here is the manifest:
The Camera2 example does work though on the same phone (Moto-X 4, Android 9).
Actually none of my devices get the camera permission, even the older ones (Android 6) which don't even need it...
It's going to be a long week-end!
When I try to fetch the camera (and storage) permissions with this:
B4X:
For Each permission As String In Array( rp.PERMISSION_READ_EXTERNAL_STORAGE, rp.PERMISSION_CAMERA )
rp.CheckAndRequest( permission )
Wait For Activity_PermissionResult( permission As String, Result As Boolean )
If Result = False Then
ToastMessageShow( "No storage or camera permission!", True )
Activity.Finish
Return
End If
Next
I tried to change the order, same thing.
Here is the manifest:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
'SetApplicationAttribute(android:theme, "@android:style/Widget.Holo.Light.ProgressBar.Small.Inverse")
'End of default text.
SetActivityAttribute(EditLog, android:windowSoftInputMode, adjustResize|stateHidden)
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)
AddPermission(android.permission.RECORD_AUDIO)
AddApplicationText(
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
)
CreateResource(xml, provider_paths,
<files-path name="name" path="shared" />
)
The Camera2 example does work though on the same phone (Moto-X 4, Android 9).
Actually none of my devices get the camera permission, even the older ones (Android 6) which don't even need it...