Nokia N97 SDK
Example Applications Guide

Data Mobility Example

1. About this Example
2. Architecture
3. Design and Implementation


1. About this Example

DataMobility is an s60 application providing developers example code to create application using connection having the following features:

Automatic connection selection is enabled by using Service Network Access Point (SNAP), also called Destination in the UI. A SNAP represents a group of Internet Access Points (IAP). Roaming on the fly is enabled by using the Mobility extension of Connection Manager API.

Finally the application also demonstrates how to use the Connection Settings UI API. Connection Settings UI API provides a UI dialog that lets the user select connection settings (SNAP, IAP, default connection or always ask) to be saved in application’s settings.

1.1 APIs demonstrated

1.2 Prerequisites

This example exists as a complete application, and has the standard Symbian OS application architecture employing the Application, Document, UI, and View classes. The example makes use of other Symbian OS concepts which the reader should be aware of before attempting to understand this example. These are:

Before running this example, a SNAP has to be configured. The SDK comes with 3 SNAPs: Internet, Operator and MMS, and one IAP: Winsock. We configure the Internet SNAP to contain the IAP Winsock. For this, start the emulator, go to Applications->Settings->Connection->Network destinations->Uncategorized. There, select Winsock, click on Options, select Organise, select Move to other destination, and select Internet.

Note:

2. Architecture

DataMobility application design follows Avkon View-switching architecture.

3. Design and Implementation

3.1 Capabilities

The program capabilities are defined in datamobility.mmp file: CAPABILITY NetworkServices.

3.2 ScalableUI

The program takes screen parameters in the start of the application and works with all screen modes. The program support changing the screen layout while the program is running.

3.3 Design goals

The application is made of two views (each having a container): the first one is the Menu View listing the "applications" that could be opened/started; the second one is the Output View printing on the screen what the launched "application" does.

Each "application" is coded in a separate class.

There are 6 "applications":

Note: The IAP value in "Standard Application" and the SNAP value in "Application Using SNAP" and "ALR Application" are hard coded and should match the CommsDat settings in the given environment.

3.4 Lifetime of the "application"

The "application" lifetime follows the Output View container, CDataMobilityAppOutputContainer, lifetime. When the user selects and opens an item in the Menu View, the selected item id is passed to CDataMobilityAppOutputContainer constructor that can instantiate the "application" related to the selected item. The "application" is terminated in CDataMobilityAppOutputContainer destructor, i.e. when the Output View is exited.

3.5 CActiveCommsMobilityApiExt and MMobilityProtocolResp classes

They demonstrate the Mobility extension of Connection Manager API. CActiveCommsMobilityApiExt is used to register an RConnection, already started, for Mobility messages notifications. When creating the instance of CActiveCommsMobilityApiExt an object implementing the interface MMobilityProtocolResp has to be given in argument. This object will get the Mobility messages notifications. In DataMobility the classes owning a pointer to CActiveCommsMobilityApiExt also implement the interface MMobilityProtocolResp. Theses classes are:

3.6 CCmApplicationSettingsUi and TCmSettingSelection classes

They demonstrate the Connection Settings UI API. CCmApplicationSettingsUi is used to instantiate the Connection Settings UI dialog. A TCmSettingSelection object keeps the setting the user has chosen with this UI dialog. In DataMobility the setting kept in TCmSettingSelection is reused to start a connection with a connection preference translated from the TCmSettingSelection object. But the setting could, for example, have been stored in file instead.

3.7 MDataMobilityPrinter interface class

MDataMobilityPrinter is a simple interface that the "applications" use to print connection events on the Output View. CDataMobilityAppOutputContainer implements MDataMobilityPrinter, it is the reason why a reference to CDataMobilityAppOutputContainer is passed to the "applications".

© Nokia 2009

Back to top