This article applies to the following:
The BlackBerry® Java® Development Environment (BlackBerry JDE) application programming interface (API) reference includes five ways to make a Hypertext Transfer Protocol (HTTP) or socket connection.
BlackBerry Enterprise Server using the BlackBerry MDS Connection Service
The BlackBerry MDS Services are included in the BlackBerry Enterprise Server software and handle all browser or connection requests and route the requests accordingly. Data flowing between the BlackBerry smartphone and BlackBerry Enterprise Server is encrypted with Advanced Encryption Standard (AES) or Triple Data Encryption Standard (Triple DES). A connection made through BlackBerry MDS provides seamless roaming across wireless service providers that support BlackBerry smartphone service.
By default, all BlackBerry smartphone models, except the BlackBerry® 6500 Series and the BlackBerry® 7500 Series, use BlackBerry MDS. The following is an example:
To make sure that an application uses BlackBerry MDS Services as its connection pathway on all BlackBerry smartphone models, append the deviceside=false parameter to the end of the URL. The following URL is an example:
BlackBerry Internet Service
Applications are also able to make connections through the BlackBerry Internet Service. This connection route is available to third-party developers and is subject to an application approval process. Data flowing over this connection is not encrypted. Hypertext Transfer Protocol over Secure Sockets Layer (HTTPS) or Secure Sockets Layer (SSL) can be used to secure a connection. A BlackBerry Internet Service connection provides seamless roaming across wireless service providers that support BlackBerry smartphone service. Currently, this transport is only available to BlackBerry Alliance Program members, subject to approval. Information about the BlackBerry Alliance Program can be found at the following web site: http://na.blackberry.com/eng/partners/alliance.jsp
Direct TCP stack
For BlackBerry smartphones running BlackBerry® Device Software 3.8 and later, a direct TCP stack is included, which allows a direct TCP connection to be opened from the BlackBerry smartphone without using BlackBerry MDS.
For BlackBerry smartphones operating on the iDEN® network, including the BlackBerry® 6510 smartphone, BlackBerry® 7510 smartphone, BlackBerry® 7520 smartphone, and BlackBerry® 7100i smartphone, a direct TCP connection is used if the deviceside parameter is not present. BlackBerry smartphones not operating on the iDEN network use BlackBerry MDS as the default connection if the deviceside parameter is not specified.
If BlackBerry MDS is not available at the time of connection, the BlackBerry smartphone reverts to direct TCP.
For the BlackBerry smartphone to use direct TCP, the user name and password fields must be completed under Options > TCP or supplied by the application. this article explains how to specify access point name (APN) information in a direct TCP connection.
To override the default behaviour of the default connection on the BlackBerry smartphone, the deviceside parameter must be included within the connection statement. The following is an example:
A Wi-Fi enabled BlackBerry smartphone is able to connect over a Wi-Fi network to the BlackBerry® Infrastructure. The BlackBerry Infrastructure exists between a BlackBerry smartphone and the BlackBerry Internet Service or BlackBerry Enterprise Server, allowing for connectivity to these components. A BlackBerry smartphone can also be configured to connect directly to a BlackBerry Enterprise Server using a virtual private network (VPN) connection over a Wi-Fi network. What this means is that applications that are making a connection through a BlackBerry Enterprise Server or BlackBerry Internet Service (options 1 and 2 ) can have their connections automatically routed through a Wi-Fi connection without any special logic required in the application. Applications can also make a connection over a Wi-Fi network directly to their destination server, bypassing the BlackBerry Infrastructure, BlackBerry Enterprise Server and BlackBerry Internet Service. To specify that a connection must be made over a Wi-Fi network, the interface=wifi parameter is used. The following is an example:
Wireless service provider WAP 1.x gateway
The connection string uses WAP parameters, which are hosted by a wireless network provider. Not all wireless service providers support connections through their WAP gateway. Contact the wireless network service to find out if support exists and to obtain a listing of their WAP gateway parameters.
The following is an HTTP connection over a WAP gateway:
The WAPGatewayIP and WAPGatewayAPN values are required parameters. Each parameter specified must be separated by a semicolon. The following is a table of supported WAP parameters:
Wireless service provider WAP 2.0 gateway
BlackBerry Device Software 4.2.0 and later includes the ability to connect through a WAP 2.0 gateway. This is done by locating the service record on the BlackBerry for the WAP 2.0 gateway and using its UID when making the connection. The following code sample demonstrates how this can be done.
ServiceBook sb = ServiceBook.getSB();