' Target SDK 28and earlier
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE) ' Implicit read capability if granted
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
Log($"PERMISSION_WRITE_EXTERNAL_STORAGE = ${Result}"$)
' Target SDK30 and later
' manually add AddPermission(android.permission.MANAGE_EXTERNAL_STORAGE) to manifest
'Use the ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION intent action to direct users to a system settings page where they can enable the following option for your app: Allow access to manage all files.
'To determine if granted call Environment.isExternalStorageManager()
'Dim in As Intent
'in.Initialize("android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION"", "package:my.package.app")
'StartActivity(in)
If Not(File.IsDirectory(File.DirRootExternal, IdeDir)) Then
File.MakeDir(File.DirRootExternal, IdeDir)
End If
If Not(File.IsDirectory(IdePath, IdeHelpDir)) Then
File.MakeDir(IdePath, IdeHelpDir)
End If
If Not(File.IsDirectory(IdePath, IdeLayoutDir)) Then
File.MakeDir(IdePath, IdeLayoutDir)
End If
If Not(File.IsDirectory(IdePath, IdeLauncherDir)) Then
File.MakeDir(IdePath, IdeLauncherDir)
End If
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
Script.GPSAvailable = True
Else
Script.GPSAvailable = False
End If