I believe Starter.rp.Check(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE) will not work with TargetSDKVersion 29 and android-29? I do not see the permission screen.
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...
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult(perm As String,res As Boolean)
Log(test)
Just FYI. Log(test) will never run with targetsdkversion 29. I think we need to eliminate this dangerous permission. Any codes below it will never run.
Hi All, I know this question has been asked many times and the answer is always this : Runtime permissions: https://www.b4x.com/search?query=Runtime+permissions . Well I have read through this several times and am more baffled than before. My Question: I have used the following code to copy...
I think i understand whats going on now. The SetApplicationAttribute(android:requestLegacyExternalStorage, true) will only work with the apps that accepted write permission in TargetSDKVersion 28 or lower.
If app is uninstalled and reinstalled with TargetSDKVersion 29, then the write permission won't work and File.DirRootExternal is useless.
That's not true. It works exactly as before. Tested with this code and a new package name:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Dim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
File.WriteString(File.DirRootExternal, "1.txt", "ttt")
End If
End Sub