I have begun using the NET library to conduct FTP communications to upload and download files to my website folders.
When I connect to my tablet with B4A_Bridge and compile and execute the following code:
I click the btnDownload and it creates the file on the dirrootexternal location but it is empty. There is no status update and no download complete.
I click the btnUpload and nothing happens at all.
I've viewed the unfiltered logs and the only thing that shows when a button is touched is:
Really, this is all that is in the unfiltered logs...
Any ideas what might be wrong?
WiFi is on, is connected (obviously b4a_bridge is running), I'm able to browse the net; http transfers work, but this ftp test code won't do anything.
Thanks,
Rusty
When I connect to my tablet with B4A_Bridge and compile and execute the following code:
B4X:
'Activity module
Sub Process_Globals
Dim FTP As FTP
End Sub
Sub Globals
Dim btnDownload As Button
Dim btnUpload As Button
Dim btnClose As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
Activity.LoadLayout("Main")
FTP.Initialize("FTP", "ftp.xxxx.com", 21, "iiii", "pppp")
End If
End Sub
Sub btnDownload_Click
FTP.DownloadFile("/dddd/filename.txt", False, File.DirRootExternal, "DELETETHIS.txt")
End Sub
Sub btnUpload_Click
FTP.UploadFile(File.DirRootExternal, "b4a_bridge.apk", False, "/dddd/DELETETHIS.apk")
End Sub
Sub FTP_DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long)
Dim s As String
s = "Downloaded " & Round(TotalDownloaded / 1000) & "KB"
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End Sub
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then Log(LastException.Message)
End Sub
Sub FTP_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
Dim s As String
s = "Uploaded " & Round(TotalUploaded / 1000) & "KB"
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End Sub
Sub FTP_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then Log(LastException.Message)
End Sub
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Log(ServerPath)
If Success = False Then
Log(LastException)
Else
For i = 0 To Folders.Length - 1
Log(Folders(i).Name)
Next
For i = 0 To Files.Length - 1
Log(Files(i).Name & ", " & Files(i).Size & ", " & DateTime.Date(Files(i).Timestamp))
Next
End If
End Sub
Sub btnClose_Click
FTP.Close
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
I click the btnUpload and nothing happens at all.
I've viewed the unfiltered logs and the only thing that shows when a button is touched is:
B4X:
void cb_onMotion(uint16_t)
GC_CONCURRENT freed 141K, 4% free 6802K/7047K, paused 3ms+2ms
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41339d48
Triggered Alarm 417d7720 RTC_WAKEUP IntentSender{417574a8: PendingIntentRecord{417fb768 com.android.vending startService}}
GC_CONCURRENT freed 594K, 10% free 7265K/8007K, paused 2ms+2ms
[1] 5.onFinished: Installation state replication succeeded.
GC_CONCURRENT freed 206K, 7% free 7479K/8007K, paused 2ms+2ms
Any ideas what might be wrong?
WiFi is on, is connected (obviously b4a_bridge is running), I'm able to browse the net; http transfers work, but this ftp test code won't do anything.
Thanks,
Rusty