Sub Service_Start (StartingIntent As Intent)
StartServiceAt(Me,DateTime.Now+30 * 1000, True)
connection
end sub
Sub connection
SMB.ListFiles(smbdownload_datapath, "*.xls")
ToastMessageShow("Updating Data", True)
Log("Service the time now is: " & DateTime.Time(DateTime.Now))
Wait for SMB_ListCompleted(Url As String, Success As Boolean, Entries() As SMBFile)
Dim I As Int
If Not(Success) Then
co_success = False
Log( "service " & co_success)
Else
co_success = True
Log("service " & co_success)
download_count = Entries.Length
For i = 0 To Entries.length -1
SMB.DownloadFile(smbdownload_datapath, Entries(i).name, File.DirInternal, Entries(i).name)
Wait for SMB_DownloadCompleted (Url As String, RemoteFile As String, Success As Boolean)
If Success = True And download_count = 3 Then
download_ver = "Letzte data Version " & DateTime.Date(Entries(0).LastModified) & " " & DateTime.Time(Entries(0).LastModified)
up_success = True
Log("service " & up_success)
Else
up_success = False
Log("service " & up_success)
End If
Next
old_download_ver = download_ver
End If
update_success = up_success
connection_success = co_success
End Sub