Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim FTP As FTP
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")
Activity.LoadLayout("DownloadUpdates")
Activity.Title = "Database Update"
FTP.Initialize("FTP", "ftp.dps.com", 21, "android@dps.com","MyPassword")
End Sub
Sub lblDownload_Click
FTP.DownloadFile("/public_html/android_db/edbq_rem.db", False, File.DirRootExternal, "edbq_rem.db")
End Sub
You do not need to call it. The event will be raised during download.where do I call: FTP_DownloadProgress ?
Sub lblDownload_Click
FTP.DownloadFile("/public_html/android_db/edbq_rem.db", False, File.DirRootExternal, "edbq_rem.db")
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_DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long)
Dim zxs As String
If Total > 0 Then
zxs = "Downloaded " & Round(TotalDownloaded / 1000) & "KB, Out Of " & Round(Total / 1000) & "KB"
Else
zxs = "Downloaded " & Round(TotalDownloaded / 1000) & "KB"
End If
LBLStat.Text = zxs
End Sub
hi,Got it,... I was missing this last line, forgot I need some screen label to show off....
I will sue the opportunity to resolve another issue....
I'm downloading SQLite database (single file).
There is a command to check SQLite database version. I need to compare it against existing database on a device. Is there any way to make a comparison before the download takes place so is the database is the same version the download will be skipped, so the user will not waste bandwidth limit.
Thanks a lot - Arthur
FTP.List("Your server path goes here")
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
If Files.Length > 0 Then
For i = 0 To Files.Length -1
Log(Files(i).Name)
Log(Files(i).Size)
Log(Files(i).Timestamp)
Next
Else
'do whatever is needed here
End If
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?