Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim POP As POP3
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.
Dim txtleggi As EditText
Dim btnpulisci As Button
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("comandemail")
If FirstTime Then
POP.Initialize("pop.gmail.com", 995, "[email protected]", "mypass", "pop")
POP.UseSSL = True 'Gmail requires SSL.
End If
POP.ListMessages
End Sub
Sub POP_ListCompleted (Success As Boolean, Messages As Map)
Log("List: " & Success)
If Success Then
For i = 0 To Messages.Size - 1
POP.DownloadMessage(Messages.GetKeyAt(i), True) 'Download all messages and delete them
Next
Else
Log(LastException.Message)
End If
POP.Close 'The connection will be closed after all messages are downloaded
End Sub
Sub POP_DownloadCompleted (Success As Boolean, MessageId As Int, Message As String)
Log("Download: " & Success & ", " & MessageId)
If Success Then
Log(Message)
Log(Message.Length)
Log(MessageId)
txtleggi.text = Message
Else
Log(LastException.Message)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub txtleggi_EnterPressed
End Sub
Sub btnpulisci_Click
txtleggi.Text=""