Android Question Make folder - Android 11

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

I am trying (Android 11, SDK 29/30):
B4X:
        Dim rperr As RuntimePermissions
        rperr.CheckAndRequest(rperr.PERMISSION_WRITE_EXTERNAL_STORAGE)
        wait for Activity_PermissionResult(permission As String, result As Boolean)

        Dim FileDirr As String
        FileDirr = starter.rp.GetSafeDirDefaultExternal("")
        File.MakeDir(FileDirr,"xxx1")
        File.MakeDir(FileDirr,"/yyy2")
        File.MakeDir(File.DirRootExternal ,  "/zzz3")
        File.MakeDir(File.DirRootExternal ,  "xzzz4")
        File.MakeDir(File.DirInternal ,  "xyxy5")
        File.MakeDir(File.DirInternal ,  "/zxyxy6")

but then I have no folder in sd card and I have no folder in mobile,
please, where I am doing mistake?

In manifest I am trying it with:
B4X:
AddManifestText(<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>)
and without this row. But same result..

Please for advice,
Thank you
p4ppc
 
D

Deleted member 103

Guest
Dear friends,

I am trying (Android 11, SDK 29/30):
B4X:
        Dim rperr As RuntimePermissions
        rperr.CheckAndRequest(rperr.PERMISSION_WRITE_EXTERNAL_STORAGE)
        wait for Activity_PermissionResult(permission As String, result As Boolean)

        Dim FileDirr As String
        FileDirr = starter.rp.GetSafeDirDefaultExternal("")
        File.MakeDir(FileDirr,"xxx1")
        File.MakeDir(FileDirr,"/yyy2")
        File.MakeDir(File.DirRootExternal ,  "/zzz3")
        File.MakeDir(File.DirRootExternal ,  "xzzz4")
        File.MakeDir(File.DirInternal ,  "xyxy5")
        File.MakeDir(File.DirInternal ,  "/zxyxy6")

but then I have no folder in sd card and I have no folder in mobile,
please, where I am doing mistake?

In manifest I am trying it with:
B4X:
AddManifestText(<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>)
and without this row. But same result..

Please for advice,
Thank you
p4ppc
you should use the "ExternalStorage" class from May 2021 for this.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Wow, I was thinking of creating an app that would add custom notification sound files to the device so that they will appear in "My Sounds" sound picker for use in notifications of other apps on the device.

But it would require creating the folder \media\audio\notifications if it didn't already exist and then creating files in that folder.

I wonder how that would be possible with TargetSDK=30 :(
 
Upvote 0
Top