An application that leverages the TCP Cellular (Direct TCP) transport needs to ensure that the device has the correct APN information available for the carrier it is connected to. The device can get this APN information from 2 sources:
Apps specifying the APN information as a parameter appended to the URL.
End-user entering the information manually in TCP IP options under Advanced System Settings of the device.
There are some challenges associated with each of these sources. Source #1 requires developers to know APN information of all carriers since if the app is deployed across multiple carriers. Source #2 is very error prone because the user can easily make a mistake while entering that information.
To solve these challenges, RIM has taken the initiative to push a service record (configuration file) on the device which will have the APN information pre-populated for the carrier the device is connected to at a given time. This service record is called the Default TCP Service Record. If this service record is present, an application can simply specify a ConnectionUID parameter in the URL and set its value to the UID of the Default TCP Service Record.
The BlackBerry® Platform provides APIs both to detect the presence of this service record as well as to leverage this service record to create a connection over the TCP Cellular transport. An easy-to-use API with full source code is provided in the KB article: What Is - Network API alternative for legacy OS. Here is a code snippet that demonstrates how to leverage the Default TCP Service Record using the above mentioned API,
Alternatively, an application can also consider using the Network API in 6.0 to use the Default TCP Service Record. The BlackBerry® 6.0 Network API which is specified under the net.rim.device.api.io.transport package, automatically uses the Default TCP Service Record (if present) when an application tries to create a network connection over TCP Cellular transport. More details on this can be found in the API documentation of the Network API.