Mobile Network Selection Tutorial

This tutorial describes settings that are used in the mobile network selection using RMobilePhone functions.

The phones can select a network:

  • automatically based on an algorithm and preferred choices

  • manually in the GSM mode after detection of available networks

The settings that determine this selection process are retrieved and set through RMobilePhone functions. These functions must be supported by the Telephony System plug-ins.

  1. Get the current selection settings using RMobilePhone::GetNetworkSelectionSetting().
  2. Set new selection settings using RMobilePhone::SetNetworkSelectionSetting()
  3. Use RMobilePhone::NotifyNetworkSelectionSettingChange() to get the notifications of any changes to the network selection settings.
  4. Request the phone to try network re-selection using RMobilePhone::SelectNetwork().

Selection can be either automatic or manual depending on the value of a RMobilePhone::TMobilePhoneNetworkManualSelection flag. The selection information is encapsulated in a RMobilePhone::TMobilePhoneNetworkSelectionV1 object.

Network settings example

The following code stores in the variable selection whether the current network selection method is automatic or manual. The code assumes iMobilePhone is an RMobilePhone object.

RMobilePhone::TMobilePhoneNetworkSelectionV1 mobilePhoneNetworkSelection;
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg mobilePhoneNetworkSelectionPckg(mobilePhoneNetworkSelection);

User::LeaveIfError(iMobilePhone.GetNetworkSelectionSetting(mobilePhoneNetworkSelectionPckg));
RMobilePhone::TMobilePhoneSelectionMethod selection = mobilePhoneNetworkSelection.iMethod;