Defining connection management items

Your application should define which connection management items (destination networks, IAPs, default connection and always ask) it supports and show only the supported items in the UI. In this example, the application supports default connection, always ask and destination networks. IAPs (if supported) of a certain destination network can be seen under the Options menu when the destination network is highlighted.

To define the connection management items:

  1. Request the connection settings dialog for supported items using the Connection Settings UI API.

  2. Show the items that your application supports in the UI using the Connection Settings UI API.

    After the user has made a selection, it is returned to the application.

  3. Store the user selection in the application's connection setup.

    For information on how to start the connection through a destination network, see Starting the connection through the destination network.

    If you want to prompt the user to make this selection, see Prompting the user to select a destination network.

The following code snippet illustrates this process.

#include <cmapplicationsettingsui.h>

TCmSettingSelection userSelection;

CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL();
CleanupStack::PushL( settings );

TUint listedItems = EShowAlwaysAsk | EShowDefaultConnection |
                    EShowDestinations | EShowConnectionMethods;

TBearerFilterArray filter;

settings->RunApplicationSettingsL( userSelection,
                                   listedItems,
                                   filter );
                                   
CleanupStack::PopAndDestroy( settings );

switch ( userSelection.iResult )
	{
	case EDestination:
	    {
        TConnSnapPref prefs;
        prefs.SetSnap( userSelection.iId );

        iConnection.Start( prefs, iStatus );
		break;
	    }
	case EConnectionMethod:
	    {
        TCommDbConnPref prefs;
        prefs.SetIapId( userSelection.iId );
        prefs.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );

        iConnection.Start( prefs, iStatus );
	    break;
	    }
	case EDefaultConnection:
	    {
	    iConnection.Start( iStatus );
	    break;
	    }
	default: // EAlwaysAsk
	    {
        TCommDbConnPref prefs;
        prefs.SetDialogPreference( ECommDbDialogPrefPrompt );

        iConnection.Start( prefs, iStatus );
	    }
	}

SetActive();

Additional information

  • If the application defines an IAP (either fixed IAP or asked from user) in connection setup, you should change it to a destination network. If the IAP where the connection has been opened is forwarded to some plug-in module, you should consider whether the destination network can be used instead.

  • Many applications store a fixed IAP that is always used in connection setup. You should change it so that a fixed destination network is used. Device management and provisioning should also be updated to support new connection settings.

  • Some applications need to know which IAP is used even if the connection has been started with a destination network, because they may need some IAP-specific setting for their operation. Examples of such settings are an SMTP server for an e-mail client and an HTTP proxy for a browser. After the connection has been started with a destination network, the selected IAP can be fetched with RConnection::GetIntSetting().

Connection Settings UI API provides a UI dialog that lets the end user select connection settings (SNAP, IAP, default connection or always ask) to be saved in the application settings. The Connection Settings UI API was introduced in S60 3rd Edition, Feature Pack 2, and it replaced the Access Point Settings Handler API.

For more information on making IP connections, see Making an IP connection.

Related S60 platform services

The S60 platform also offers the following related services: