Android Question New Directory made, but where is it?

Tjitte Dijkstra

Member
Licensed User
I create a new directory in this way:
(There is a global called NewDir
There is an EditText2 for textinput)

Sub MakeNewDirectory_Click
IfEditText2 <> Null Then
NewDir = EditText2.text
File.MakeDir(File.DirInternal,NewDir)
End If
End Sub

But, where can I find mny newly made directory on the Tablet?
 

DonManfred

Expert
Licensed User
But, where can I find mny newly made directory on the Tablet?
As it is the in File.DirInternal you dont find the folder when connecting over usb. It is a secured path. Only you (your app) can access this folder. No other app. Connecting over usb will act lik "another" app in this case so the folder is not visible to the pc unless your device is rooted (I THINK SO).
Try to search for the folder in \Phone\Android\data\[packagename]

PS: Please use code-tags when posting code here in forum!
 

Tjitte Dijkstra

Member
Licensed User
Sub Thnx_Manfred,
I used spaces, but apperently they were removed.
Better next time​
I am new here 'with some 25 years of experience in Pascal & Delphi
End Sub
 

DonManfred

Expert
Licensed User
Sub Thnx_Manfred,
:)

To use CODE-Tags here:

1. Click on


2. Click on


3. Input your code in the showing dialog



This result in:

B4X:
    Dim de As String = File.DirRootExternal
    Log ("DirRootExternal = "&de)
    Dim mtc As Matcher = Regex.Matcher("(/|\\)[^(/|\\)]*(/|\\)",de)
    Dim extsdcard As String = de
    If mtc.Find = True Then
        Dim mnt As String = mtc.Group(0)
       
        Log ("mount point = "& mnt)
        Dim dirs As List = File.ListFiles(mnt)
        For Each f As String In dirs
        Log ("Device = "& f)
            If f.ToLowerCase.Contains("extsdcard") Then
                extsdcard = mnt&f
            End If
        Next
    End If
    Log("extsdcard="&extsdcard)
    For Each f As String In File.ListFiles(extsdcard)
        Log(">"&f)
    Next
 
Top