I have found that if targetSdkVersion is "33" - no PERMISSION_WRITE_EXTERNAL_STORAGE is shown in the app settings. And no request system dialog and Waiting For permission request is always with False result.
It's in B4xPages structure app, tested under Android 13 device and 2 emulators (Android 10).
B4A v.12.5, rp lib v.1.20.
Just changed into targetSdkVersion="32" - no problem with the dialog and app work.
Is it known ?
Starting from targetSdkVersion=29 (Android 10) you cannot directly access the external storage. Maybe you previously used requestLegacyExternalStorage which works until targetSdkVersion=30.
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
AddManifestText(
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="19" />
)
AddManifestText(
<uses-permission
android:name="android.permission.READ_MEDIA_IMAGES"
android:minSdkVersion="33" />
)
B4XMainPage:
Private Sub B4XPage_Created (Root1 As B4XView)
Dim ph As Phone 'phone lib
If ph.SdkVersion = 33 Then
rp.CheckAndRequest("android.permission.READ_MEDIA_IMAGES") 'rp = RuntimePermissions lib
Else
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
End If
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
If Result = True Then
....