I have read a lot, but I still cannot get the WRITE_EXTERNAL_STORAGE permission to work.
I have a simple FTP test program that works with android:targetSdkVersion="22", but not 26.
The following code give me an error with 26, but not 22:
java.io.FileNotFoundException: /storage/emulated/0/Golf_Match/Test.txt (Permission denied)
My manifest looks like the following:
Is it possible to write to a directory that is not a subfolder or the main program with sdk 26?
If so, what am I doing wrong?
I have a simple FTP test program that works with android:targetSdkVersion="22", but not 26.
The following code give me an error with 26, but not 22:
java.io.FileNotFoundException: /storage/emulated/0/Golf_Match/Test.txt (Permission denied)
B4X:
FTP.DownloadFile("Test.txt", False, File.DirRootExternal, "Golf_Match/Test.txt")
My manifest looks like the following:
B4X:
'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="16" android:targetSdkVersion="26"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="19" />
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
'---------- Permissions ------------------
AddPermission(android.permission.READ_EXTERNAL_STORAGE) ' Allows an application to read from external storage.
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE) ' Allows an application to write to external storage.
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
Is it possible to write to a directory that is not a subfolder or the main program with sdk 26?
If so, what am I doing wrong?
Last edited: