net.rim.device.api.io.transport
Class TransportInfo

java.lang.Object
  extended by net.rim.device.api.io.transport.TransportInfo

public class TransportInfo
extends Object

This class provides methods that provide information about the transport types available on a BlackBerry device. It also enables you to check that a given transport type has the required coverage.

To establish a connection over a particular transport type two requirements must be met. The transport type must be available and the transport type must have sufficient coverage to establish a reliable connection.

See Also:
TransportDescriptor
Since:
BlackBerry API 5.0.0

Field Summary
static int TRANSPORT_BIS_B
          Represents the Blackberry Internet Service transport type
static int TRANSPORT_MDS
          Represents the MDS transport type
static int TRANSPORT_TCP_CELLULAR
          Represents TCP Cellular transport also known as Direct TCP
static int TRANSPORT_TCP_WIFI
          Represents the WIFI transport type
static int TRANSPORT_WAP
          Represents the Wap 1.0 and Wap 1.1 transport types
static int TRANSPORT_WAP2
          Represents the Wap 2.0 transport type
 
Method Summary
static void addListener(CoverageStatusListener coverageListener)
          Adds the specified CoverageStatusListener Listener will be wrapped with WeakReference
static int[] getAvailableTransportTypes()
          Retrieves all the available transport types on the device (regardless of coverage) .
static TransportDescriptor[] getAvailableTransports()
          Retrieves the TransportDescriptors for all the available (regardless coverage) transports on the device.
static int[] getCoverageStatus()
          Retrieves all the transport types with sufficient coverage on the device.
static TransportDescriptor[] getTransportDescriptors(int transportType)
          Provides an array of TransportDescriptor for the specified transportType
static TransportDescriptor[] getTransportDescriptors(int[] transportTypes)
          Retrieves information for a group of transport types.
static String getTransportTypeName(int transportType)
          Provides the name for the specified transportType
static boolean hasSufficientCoverage(int transportType)
          Determines if there's sufficient coverage to use the specified transportType
static boolean isTransportAvailable(int transportType, String ConnectionUID)
          Determines whether or not the device is currently capable of using the specified transport instance (i.e. the device supports the specified transportType, and using the specified ConnectionUID.
static boolean isTransportTypeAvailable(int transportType)
          Determines whether or not the device is currently capable of using the specified transportType (i.e. the necessary hardware and proper service record are present).
static void removeListener(CoverageStatusListener coverageListener)
          Removes the specified CoverageStatusListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

TRANSPORT_TCP_CELLULAR

public static final int TRANSPORT_TCP_CELLULAR
Represents TCP Cellular transport also known as Direct TCP

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

TRANSPORT_WAP

public static final int TRANSPORT_WAP
Represents the Wap 1.0 and Wap 1.1 transport types

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

TRANSPORT_WAP2

public static final int TRANSPORT_WAP2
Represents the Wap 2.0 transport type

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

TRANSPORT_MDS

public static final int TRANSPORT_MDS
Represents the MDS transport type

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

TRANSPORT_BIS_B

public static final int TRANSPORT_BIS_B
Represents the Blackberry Internet Service transport type

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

TRANSPORT_TCP_WIFI

public static final int TRANSPORT_TCP_WIFI
Represents the WIFI transport type

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0


Method Detail

isTransportTypeAvailable

public static boolean isTransportTypeAvailable(int transportType)
Determines whether or not the device is currently capable of using the specified transportType (i.e. the necessary hardware and proper service record are present).

Parameters:
transportType - One of the TRANSPORT_* defined on TransportInfo
Returns:
true if the device is capable of using the specified transportType false otherwise
Since:
BlackBerry API 5.0.0

isTransportAvailable

public static boolean isTransportAvailable(int transportType,
                                           String ConnectionUID)
Determines whether or not the device is currently capable of using the specified transport instance (i.e. the device supports the specified transportType, and using the specified ConnectionUID.
Passing null for the ConnectionUID will cause the method to behave as isTransportTypeAvailable()

Parameters:
transportType - One of the TRANSPORT_* defined on TransportInfo
ConnectionUID - The UID of the ServiceRecord for a specific transport instance
Returns:
true if the device is capable of using the specified transport instance false otherwise
Since:
BlackBerry API 5.0.0

getAvailableTransportTypes

public static int[] getAvailableTransportTypes()
Retrieves all the available transport types on the device (regardless of coverage) .

Returns:
an array of transportType representing the available transport types
Since:
BlackBerry API 5.0.0

getAvailableTransports

public static TransportDescriptor[] getAvailableTransports()
Retrieves the TransportDescriptors for all the available (regardless coverage) transports on the device.

Returns:
an array of TransportDescriptor representing the available transports (regardless coverage and type)
Since:
BlackBerry API 5.0.0

getCoverageStatus

public static int[] getCoverageStatus()
Retrieves all the transport types with sufficient coverage on the device.

Returns:
an array of transportType representing the transport types with sufficient coverage.
Since:
BlackBerry API 6.0.0

getTransportDescriptors

public static TransportDescriptor[] getTransportDescriptors(int transportType)
Provides an array of TransportDescriptor for the specified transportType

Parameters:
transportType - One of the TRANSPORT_* defined on TransportInfo
Returns:
an array TransportDescriptor objects containing information about the transports corresponding to the specified transportType
Since:
BlackBerry API 5.0.0

getTransportDescriptors

public static TransportDescriptor[] getTransportDescriptors(int[] transportTypes)
Retrieves information for a group of transport types.

Parameters:
transportTypes - and array of the TRANSPORT_* defined on TransportInfo
Returns:
an array of TransportDescriptors
Since:
BlackBerry API 5.0.0

hasSufficientCoverage

public static boolean hasSufficientCoverage(int transportType)
Determines if there's sufficient coverage to use the specified transportType

Parameters:
transportType - One of the TRANSPORT_* defined on TransportInfo
Returns:
true if enough coverage is available to use the specified transport. false otherwise.
Since:
BlackBerry API 5.0.0

getTransportTypeName

public static String getTransportTypeName(int transportType)
Provides the name for the specified transportType

Parameters:
transportType - One of the TRANSPORT_* defined on TransportInfo
Returns:
The English transport's name. "Unknown" is returned for invalid transportTypes
Since:
BlackBerry API 5.0.0

addListener

public static void addListener(CoverageStatusListener coverageListener)
Adds the specified CoverageStatusListener Listener will be wrapped with WeakReference

Parameters:
coverageListener - the CoverageStatusListener to add
Throws:
NullPointerException - if the coverageListener parameter is null
Since:
BlackBerry API 6.0.0

removeListener

public static void removeListener(CoverageStatusListener coverageListener)
Removes the specified CoverageStatusListener

Parameters:
coverageListener - the CoverageStatusListener to remove
Throws:
NullPointerException - if the coverageListener parameter is null
Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal