Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE task
PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task xml:lang="en" id="GUID-89D0839A-942B-58FF-A0E6-A0FDBFC92236"><title>Mobile Network Selection Tutorial</title><shortdesc>This tutorial describes settings that are used in the mobile network selection using <apiname>RMobilePhone</apiname> functions. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> <context><p>The phones can select a network: </p> <ul><li id="GUID-F5EE89E8-4234-5750-B469-C32C8C63F4A3"><p>automatically based on an algorithm and preferred choices </p> </li> <li id="GUID-534D4B64-12CF-5EC7-808C-C53A78ACBF50"><p>manually in the GSM mode after detection of available networks </p> </li> </ul> <p>The settings that determine this selection process are retrieved and set through <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone</apiname></xref> functions. These functions must be supported by the Telephony System plug-ins. </p> <p> </p> </context> <steps id="GUID-AC3C5D8F-877E-5E1F-AA5F-AC8D3B7B3929"> <step id="GUID-0441C776-9C52-568A-9134-EEA3BCF2A2E4"><cmd>Get the current selection settings using <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::GetNetworkSelectionSetting()</apiname></xref>. </cmd> </step> <step id="GUID-34C098DA-0059-5A4E-9274-24B4254A8579"><cmd>Set new selection settings using <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::SetNetworkSelectionSetting()</apiname></xref> </cmd> </step> <step id="GUID-BFAE5D8A-1FD0-5269-8806-35893471F1BF"><cmd>Use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::NotifyNetworkSelectionSettingChange()</apiname></xref> to get the notifications of any changes to the network selection settings. </cmd> </step> <step id="GUID-B6C13453-188F-5BEF-9B50-B9ADB9C18771"><cmd>Request the phone to try network re-selection using <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::SelectNetwork()</apiname></xref>. </cmd> </step> </steps> <result><p>Selection can be either automatic or manual depending on the value of a <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::TMobilePhoneNetworkManualSelection</apiname></xref> flag. The selection information is encapsulated in a <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::TMobilePhoneNetworkSelectionV1</apiname></xref> object. </p> <p> </p> </result> <example><title>Network settings example</title> <p>The following code stores in the variable <codeph>selection</codeph> whether the current network selection method is automatic or manual. The code assumes <codeph>iMobilePhone</codeph> is an <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone</apiname></xref> object. </p> <codeblock id="GUID-EA7431BC-389B-57DE-A8A7-9732C586E203" xml:space="preserve">RMobilePhone::TMobilePhoneNetworkSelectionV1 mobilePhoneNetworkSelection;
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg mobilePhoneNetworkSelectionPckg(mobilePhoneNetworkSelection);
User::LeaveIfError(iMobilePhone.GetNetworkSelectionSetting(mobilePhoneNetworkSelectionPckg));
RMobilePhone::TMobilePhoneSelectionMethod selection = mobilePhoneNetworkSelection.iMethod;
</codeblock> </example> </taskbody></task>