This article applies to BlackBerry® devices based on Java®.
When an application creates a direct Transmission Control Protocol (TCP) connection, the BlackBerry device uses the Access Point Name (APN) information.
Note: For instructions on specifying the APN settings on the BlackBerry device, see this article. For instructions on creating a socket or HTTP connection, see this article.
However, it is possible for an application to specify the APN information used for a direct TCP connection. This information overrides anything configured in the TCP options of a BlackBerry device. The following line of code is an example of a direct TCP socket connection that provides direct TCP APN parameters:
The apn parameter contains the APN over which the connection will be made.
The tunnelauthusername parameter contains the user name to connect to the APN.
The tunnelauthpassword parameter contains the password for the tunnelauthusername.
The tunnelauthusername and tunnelauthpassword parameters can be omitted from the connection URL if they are not required by the APN.
Note: The deviceside=true parameter is present in the example above to make sure that the connection is made using direct TCP. These parameters are only useful when creating a direct TCP connection and are not required when making a connection through the BlackBerry Mobile Data System. Connections through the BlackBerry Mobile Data System are automatically routed by the BlackBerry device; therefore, no APN information is required.