Mobile Network Tutorial

This tutorial describes how to get the current and home network information using the RMobilePhone functions.

Use the RMobilePhone functions to get information about the current, home, and detected networks.

To query what network information is available, use RMobilePhone::GetNetworkCaps(). The RMobilePhone functions are used to get the network information.

CRetrieveMobilePhoneDetectedNetworks is provided to get a list of all the detected networks.

  1. Use RMobilePhone::GetCurrentMode() to get information about the current network mode, for example, GSM or CDMA. Modes are described by RMobilePhone::TMobilePhoneNetworkMode.
  2. Use RMobilePhone::NotifyModeChange() to get the notification of any changes to the mode.
  3. Use RMobilePhone::GetCurrentNetwork() to get details, such as the network mode, status, and identity or name as appropriate to the mode, of the current network. The information is returned in a RMobilePhone::TMobilePhoneNetworkInfoV2 object (RMobilePhone::TMobilePhoneNetworkInfoV1 in the v1 API). In GSM mode, it may also be possible to return information on the current location of the phone, in an RMobilePhone::TMobilePhoneLocationAreaV1 object.
  4. Use RMobilePhone::NotifyCurrentNetworkChange() to get the notification of changes to the current network.
  5. Use RMobilePhone::GetHomeNetwork() to get details about the home network. This will be the same as the current network, unless the phone is roaming as a guest on in another network.
  6. Use RMobilePhone::GetNetworkRegistrationStatus() to get information about the current network registration status.
  7. Use RMobilePhone::NotifyNetworkRegistrationStatusChange() to get notification of any changes to the network registration status.

Network information example

The following code checks if the information about the current network can be obtained, and if so, gets that information, and reads from it the full network name.

The code assumes iMobilePhone is an RMobilePhone object.

TUint32 networkCaps;
RMobilePhone::TMobilePhoneNetworkLongName networkName;
if (networkCaps & RMobilePhone::KCapsGetCurrentNetwork)
    RMobilePhone::TMobilePhoneNetworkInfoV1 mobilePhoneNetworkInfo;
    RMobilePhone::TMobilePhoneNetworkInfoV1Pckg mobilePhoneNetworkInfoPckg(mobilePhoneNetworkInfo);
    RMobilePhone::TMobilePhoneLocationAreaV1 mobilePhoneLocationArea;
    TRequestStatus status;
    iMobilePhone.GetCurrentNetwork(status, mobilePhoneNetworkInfoPckg, mobilePhoneLocationArea);
    networkName = mobilePhoneNetworkInfo.iLongName;

After retrieving the network information, the device has to selects a network to use. See Mobile Network Selection Tutorial for more information on how to get and set the parameters to select a network.

Once a network is selected the user decides to automatically update the date and time from the network. See Network Date and Time Tutorial for more information on how to receive date and time from the network.