B4J Question Transfer file from Downloads folder to Music folder in internal storage using B4J


I am trying to connect my phone to my computer or laptop using a USB cable. Then, I want to use B4J to transfer a file from the Downloads folder in the internal storage of my phone to the Music folder in the internal storage.

I would appreciate it if you could guide me on how I can do this.

Thank you
I myself wrote this function in B4J:
Private Sub Button1_Click

End Sub

Sub Copy(DirSource As String, FileSource As String, DirTarget As String, FileTarget As String,First As Boolean)
    If File.IsDirectory(DirSource, FileSource) Then
        If First Then
            File.MakeDir(File.Combine(DirTarget, FileTarget),FileSource)
            DirTarget=File.Combine(DirTarget, FileTarget)
        End If
        Dim sourcePath As String = File.Combine(DirSource, FileSource)
        Dim targetPath As String = File.Combine(DirTarget, FileTarget)
        Dim sourceFiles As List = File.ListFiles(sourcePath)
        If sourceFiles.IsInitialized = False Then Return 'Return if folder is not accessible
        File.MakeDir(DirTarget, FileTarget)
        For Each name As String In sourceFiles
            If File.IsDirectory(sourcePath, name) Then
                Copy(sourcePath, name, targetPath, name,False)
                File.Copy(sourcePath, name, targetPath, name)
            End If
        File.Copy(DirSource, FileSource, DirTarget, FileTarget)
    End If
End Sub
Now this code works and copies the NewFolder folder into NewFolder2 on the desktop. But I don't know how to identify the phone connected to the computer and do the same operation for it!
Upvote 0