Sub Process_Globals
Dim FTP1 As FTP
Dim timerview As Timer
End Sub
Sub Globals
Dim exRoute As String
Dim List1 As List
Dim FileNumber As Int
Dim FileCount As Int
Dim ImageView1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("aa")
FTP1.Initialize("FTP", "192.168.1.110", 21, "1", "1")
FTP1.List("")
timerview.Initialize("timerview",5000)
FileCount =0
List1.Initialize
exRoute = ("/LocalDisk/Bilder")
List1 = File.ListFiles (exRoute )
If List1.Size > 0 Then
FileCount = List1.Size
FileNumber =-1
timerview.Enabled = True
End If
End Sub
Sub FTP1_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 timerview_tick
Dim sFile As String
FileNumber = FileNumber + 1
If FileNumber +1 > FileCount Then
FileNumber=0
End If
sFile= List1.Get (FileNumber)
ImageView1.Bitmap=LoadBitmap(exRoute,sFile)
End Sub