Erel, i had to create this thread. Please test the attach file. This is an example of my project. The write permission dialog will not appear if File.WriteString(File.DirRootExternal, "1.txt", "ttt") is disabled. Try enabling it, then the dialog will appear. This is the strange issue i was experiencing and hopefully there is an explanation for this?
Test with TargetSDKVersion 29 and Android-29
Samsung S10+ with Android 10
If you just want to write to the default external folder, you don't need permissions, or the legacy line in the manifest.
B4X:
Sub Activity_Create(FirstTime As Boolean)
InitRuntimePermission
End Sub
Sub InitRuntimePermission
Dim RE As String = rp.GetSafeDirDefaultExternal( "" )
File.WriteString( RE, "file.txt", "ttt")
End Sub
If you just want to write to the default external folder, you don't need permissions, or the legacy line in the manifest.
B4X:
Sub Activity_Create(FirstTime As Boolean)
InitRuntimePermission
End Sub
Sub InitRuntimePermission
Dim RE As String = rp.GetSafeDirDefaultExternal( "" )
File.WriteString( RE, "file.txt", "ttt")
End Sub
Yes, i understand. I was migrating File.DirRootExternal to GetSafeDirDefaultExternal in my app. I created a function to transfer files from File.DirRootExternal to GetSafeDirDefaultExternal. So, i still need that write permission
Do you think b4a should automatically include android.permission.WRITE_EXTERNAL_STORAGE when using this code rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)?