The S60 platform allows applications to make different types of IP connections, depending on the mobile device characteristics. To check if a feature is available on the mobile device from your application, use the Feature Discovery API.
Typical use cases for an application that uses an IP connection include:
Transferring data over TCP/UDP sockets
Resolving a Domain Name System (DNS) name
Implementing a TCP server
Finding the network interface IP address
Monitoring the interface status
Important implementation considerations include:
If your application tries to establish a connection using an internet access point (IAP) that is being used by an already existing connection, the system automatically attaches your connection to that IAP. As a result, the IAP and the network interface is used by two applications.
When implementing your application, it is recommended that you take it into account that mobile network connections cost the mobile device user money and consider keeping the user informed when establishing connections.
In addition to transferring data over an IP connection, monitoring the connection status and changes in the network consumes power. This means that idle connections and frequent checks for connection status can reduce battery life unnecessarily. For more information on power consumption management, see Power Management documentation provided by Forum Nokia.
To establish a connection:
Establish a connection using the Sockets Client API.
The RSocketServ and RConnection classes are particularly relevant for establishing a connection. Use the RHostResolver class to resolve the DNS name.
If you start the connection without giving any connection settings as parameters, the system will automatically query the mobile device user to select the appropriate internet access point (IAP) to use for the connection.
Note: The selected IAP is used for the lifetime of the RConnection
instance.
If you wish to save the IAP settings for using the same IAP every time your
application makes an IP connection, you need to enable this programatically.
Monitor your connection using the Connection Monitor Server API so that your application is able to handle unexpected connection breaks or changes in the network characteristics.
The API is used through the methods provided by the RConnectionMonitor class. Register an observer that is an instance of the MConnectionMonitorObserver class. For detailed information on how to do this, see:
Connecting to Connection Monitor Server for instructions on how to start using the connection monitor server
Registering to receive events from Connection Monitor Server for instructions on how to register an event observer
You can also use the RConnection class of the Sockets Client API to monitor connections.
Open a socket for data operations using the RSocket class of the Sockets Client API.
For reasons
pertaining to the nature of mobile device connections, close the socket
and then the network connection when your application no longer needs the
connection. For closing the network connection, it is recommended that you
use the RConnection::Close()
method to avoid breaking other
connections that might be using the same network interface.
For more information, see:
Using Sockets Client in the Symbian OS Library for instructions on how to use the Sockets Client API
A general overview and examples on how to get information on active connections using the Connection Monitor Server API
Internet Access Points Example provided by Forum Nokia for a reference example of opening an IP connection and monitoring open connections
The S60 platform also offers the following related services:
Dialog and note components for notifying the mobile device user of network connections
Browsing and downloading for enabling content browsing and downloading services through your application
Secure Sockets API for adding authentication to an IP connection and encrypting the data that is transferred
Note: This API is provided by the Symbian OS.
HTTP Client API for using the HTTP protocol for communication over the Internet
Note: This API is provided by the Symbian OS.