Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Specify APN information for a direct TCP connection

by BlackBerry Development Advisor on ‎02-17-2010 12:00 PM - edited on ‎11-22-2010 07:25 PM by Anonymous(anon) (11,364 Views)

Summary

 

This article applies to BlackBerry® devices based on Java®.

 


Procedure

 

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:

 

 

Connector.open
("socket://yourServer:5445;deviceside=true;apn=internet.com;
tunnelauthusername=user165;tunnelauthpassword=user165password")

 

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.

Contributors
Users Online
Currently online: 33 members 916 guests
Recent signins:
Please welcome our newest community members: