Android Question Storage Library and Api 30 (android 11)

bernardR

Member
Licensed User
Longtime User
Bonjour,
I use the excellent storage library under api 29.
I do not have the possibility of testing in API 30.
Are there any additional permissions to see if a storage isExternalStorageRemovable?
Thanks
 

bernardR

Member
Licensed User
Longtime User
My code for api 22 to 30
B4X:
Sub Globals
    Dim storage As env
    Dim sdCard As String
End Sub

Sub Activity_Create(FirstTime As Boolean)
    storage.Initialize
    sdCard=detectCardExt
    Msgbox(sdCard,"sdCard")
    ExitApplication
End Sub

Sub detectCardExt As String
    Dim de As String = File.DirRootExternal
    Dim mtc As Matcher = Regex.Matcher("(/|\\)[^(/|\\)]*(/|\\)",de)
    If mtc.Find = True Then
        Dim mnt As String = mtc.Group(0)
        Dim dirs As List
        dirs.Initialize
        dirs=File.ListFiles(mnt)
        For Each f As String In dirs
            If storage.isExternalStorageRemovable(mnt&f) Then
                Return f
            End If
        Next
    End If
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
This is an very old Library.

Erel is refering to this one. this is the one you should use on targetsdk = 30
 
Upvote 0

bernardR

Member
Licensed User
Longtime User
Thank you for your answers. I tried with externalstorage.
But I can't get only the name of the removable card for display.
Do you have please an example
 
Upvote 0
Top