Press on the image to return to the main documentation page.
NetExtras
Written by B4A Net library modified by Martin Pearman
NetExtras is a modified version of the official B4A Net library. FTPResume is a modified version of the FTP Object. It's DownloadFileResume replaces DownloadFile and it's UploadFileResume replaces UploadFile. Both of these two new methods support resume of incomplete file download and upload. SMTPExtras is a modified version of the SMTP object. It has been modified to allow additional (custom) header fields to be added to the outgoing email, and control over the connection timeout periods. NetExtras is based on version 1.52 of the B4A Net library.
CommandCompleted (Command As String, Success As Boolean, ReplyCode As Int, ReplyString As String) DeleteCompleted (ServerPath As String, Success As Boolean) DownloadCompleted (ServerPath As String, Success As Boolean) DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long) ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry) UploadCompleted (ServerPath As String, Success As Boolean) UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
Closes the connection after all submitted tasks finish. Note that this method does not block.
CloseNow
Closes the connection immediately without waiting for current tasks to finish. The data connection will only be closed when UploadProgress or DownloadProgress events fire.
DeleteFile (ServerPathAsString)
Deletes a file from the server. The DeleteCompleted event will be raised when this task completes.
Downloads or resumes down of a file from the server. The DownloadCompleted event will be raised when download completes. DownloadProgress events will be raised during download. ServerFilePath - Full path to the remote file. AsciiFile - If True then end of line characters will be converted as needed. Note that Android end of line character is the same as Unix / Linux. DeviceFolder - Folder that the file will be saved to. DeviceFile - The name of the local file that will be created. RestartOffset - The first byte to request if resuming an incomplete download. Pass 0 if you wish to download the entire file.
Initializes the object and sets the subs that will handle the events
IsInitializedAsBoolean
Tests whether the object was initialized.
List (ServerPathAsString)
Fetches the list of folders and files in the specified path. The ListCompleted event will be raised when the data is available.
PassiveModeAsBoolean
Gets or sets whether FTP is in passive mode. The default mode is active mode.
SendCommand (CommandAsString, ParametersAsString)
Sends an FTP command. The CommandCompleted event will be raised with the server reply. Should only be used with commands that return the reply in the command channel (not the data channel). It is possible that Success will be false and LastException will not be initialized. Common commands: MKD - Creates a new folder. RMD - Deletes an empty folder. Example: FTP.SendCommand("MKD", "/somefolder/newfolder")
Uploads a file to the server. The UploadCompleted event will be raised when upload completes. UploadProgress events will be raised during the upload. DeviceFolder - Local folder. DeviceFile - Local file name. AsciiFile - If True then end of line characters will be converted as needed. Note that Android end of line character is the same as Unix / Linux. ServerFilePath - Full path to file that will be created on the server. RestartOffset - The first byte to send if resuming an incomplete upload. Pass 0 if you wish to upload the entire file.
UseSSLAsBoolean
Gets or sets whether the connection should be done with SSL sockets (FTPS Implicit).
UseSSLExplicitAsBoolean
Gets or sets whether the connection should be done with SSL sockets (FTPS Explicit).
SMTP object allows you to send emails with no user intervention and without relying on the device installed mail clients. Both text messages and Html messages are supported as well as file attachments. There are two encryption modes supported: UseSSL and StartTLSMode. UseSSL means that the connection will be based on a SSL connection right from the start. StartTLSMode means that the connection will only be upgraded to SSL after the client send the STARTTLS command. Most SMTP servers support this mode. Gmail for example supports both modes. UseSSL on port 465 and StartTLSMode on port 587.
Initializes the object. Server - Server address. Host name or Ip. Port - Mail server port. Username - Account user name. Password - Account password. EventName - The name of the sub that will handle the MessageSent event.
Send
Sends the message. The MessageSent event will be raised after the message was sent. Note that the message fields are cleared after this method to allow you to send new messages with the same object.
SenderAsString
Gets or sets the Sender field. By default it is the same as the Username.
SoTimeoutAsInt [write only]
Set the timeout in milliseconds of a currently open socket connection. Default value is 60000.
StartTLSModeAsBoolean
Gets or sets whether the connection should be done in StartTLS mode.
SubjectAsString
Gets or sets the message subject.
TagAsObject
Gets or Sets a Tag object for the email task to be sent. If a Tag object is set then the Send method will raise the event MessageSent2(Success As Boolean, Tag As Object) instead of the event MessageSent(Success As Boolean). A unique Tag object can therefore be used to identify which email has been sent.
ToAsList
Gets or sets the list of "To" recipients. Example:SMTP.To.Add("email@example.com")
UseSSLAsBoolean
Gets or sets whether the connection should be done with SSL sockets.
Top