rp.GetAllSafeDirsExternal("") returns a very specific folder. You can log it to see.
It will not help you with accessing the existing folder. You need to request the external storage permission at runtime. Make sure to
remove this snippet:
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="19" />)
Thanks Erel,
I never thought the folder ABT was related to the sub folder mentioned in your app.
The code I posted
is requesting the external runtime permission at run time and everything works in it's original form but from the tutorial it appeared I needed the code snippet in the manifest and to change:
'If File.Exists(File.DirRootExternal&"/ABT/", "") = False Then File.MakeDir(File.DirRootExternal&"/ABT/", "")
to something like:
If File.Exists(rp.GetAllSafeDirsExternal("/ABT/"), "") = False Then File.MakeDir(rp.GetAllSafeDirsExternal("/ABT/
for devices pre-android version 5.
I can can only assume I have confused myself in the tutorial and I will return to my original code. I don't have an Android device pre-version 5 so I will just have to see if a user has a problem.
I have removed the snippet from the manifest.
I have returned the code to the original as shown below.
'***** Checks for Permission to read/write external memory and creates directory to save files. ************
If rp.Check("android.permission.WRITE_EXTERNAL_STORAGE") = False Then
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Permission = "android.permission.WRITE_EXTERNAL_STORAGE" And Result = True Then
If File.Exists(File.DirRootExternal&"/ABT/", "") = False Then File.MakeDir(File.DirRootExternal&"/ABT/", "")
End If
Else
If File.Exists(File.DirRootExternal&"/ABT/", "") = False Then File.MakeDir(File.DirRootExternal&"/ABT/", "")
End If
Regards Roger