Choosing network transports using the Network API

In the Network API, the TransportInfo class provides information about the network transports that are available on a BlackBerry® device. You can retrieve a list of transports that currently have coverage, or use the API to determine whether a particular transport is available and has coverage.

If you don't provide an ordered list of preferred transports when you open a connection, the Network API chooses a transport for you. However, you should prioritize the transports that your application uses based on the type of user that your application targets. The API steps through an array of transport types that you set by using ConnectionFactory.setPreferredTransportTypes().

After you list your preferred transports, you should set options for any transports that require specific options. For example, the WAP 1.0 and 1.1 transports require information about an APN, and the gateway authentication, and so on. For more information, see "Network transport options".

You should also create a CoverageStatusListener object (in the net.rim.device.api.io.transport package), and register it using TransportInfo.addListener(). The device notifies your application about changes in coverage status so that your application can respond appropriately.

Previous topic: The Network API

Was this information helpful? Send us your comments.