It appears that the files are downloaded but the downloadcompleted doesn't fire nor does the downloadprogress
Sub ftpStart
ftp.Initialize("ftp",Starter.sys_ftpsite,21,Starter.sys_ftpun,Starter.sys_ftppw)
Main.ftpactive = ftp.IsInitialized
If Main.ftpactive = False Then
ToastMessageShow("FTP Failed to Initiailized",True)
StartActivity(setup)
ftp.Initialize("ftp",Starter.sys_ftpsite,21,Starter.sys_ftpun,Starter.sys_ftppw)
Main.ftpactive = ftp.IsInitialized
Log("ftp failed")
Else
Log("ftp Successed")
End If
End Sub
Sub Process_Globals
Private ftp As FTP
End Sub
Sub Service_Create
ftp.Initialize("ftp", ...)
Dim sf As Object = ftp.DownloadFile(...)
Wait For (sf) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
Log("download completed: " & Success)
End Sub
Sub downloadfile
Starter.ftp.Initialize("ftp",Starter.sys_ftpsite,21,Starter.sys_ftpun,Starter.sys_ftppw)
Log("downloadfile Files")
Dim sf1 As Object = Starter.ftp.DownloadFile("/Sutherlin/download/live/routefile2.csv",False,File.dirrootexternal,"returncust2.txt")
Wait For (sf1) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("Customer file was download successfully")
Else
Log("Error download file")
End If
Dim sf2 As Object = Starter.ftp.DownloadFile("/Sutherlin/download/live/containfile2.csv",False,File.DirRootExternal,"returncont2.txt")
Wait For (sf2) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("Container file was download successfully")
Else
Log("Error Container file")
End If
Dim sf3 As Object = Starter.ftp.DownloadFile("/Sutherlin/download/live/notes2.csv",False,File.DirRootExternal,"returnnote2.txt")
Wait For (sf3) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("Note file was download successfully")
Else
Log("Error Note file")
End If
Dim sf4 As Object = Starter.ftp.DownloadFile("/Sutherlin/download/live/driver2.csv",False,File.DirRootExternal,"driver2.txt")
Wait For (sf4) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("Note file was driver successfully")
Else
Log("Error driver file")
End If
End Sub
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private ftp As FTP
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
ftp.Initialize("ftp","mobilelogixs.com",21,"Patfahey","Truckuser!1")
Dim sf As Object = ftp.DownloadFile("/sutherlin/download/live/routefile2.csv",False,File.dirrootexternal,"Returncust2.txt")
Wait For (sf) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
Log("download completed: " & Success)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
You need to use the latest version.My NET Library is Version 1.62
Let me search for you: https://www.b4x.com/android/forum/pages/results/?query=b4a+net+library&prefix=1,2,3,17,24,29How do I get the latest net Library