|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-DCA2880E-7DF9-5E60-8F87-241711935389" xml:lang="en"><title>FeatMngrExample: |
|
13 dynamic feature management example</title><shortdesc>This example demonstrates the use of Feature Manager APIs for dynamic |
|
14 feature management. It also demonstrates how to receive notification about |
|
15 changes to a feature. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
16 <section><title>Download</title> <p>Click on the following link to download |
|
17 the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-3bc38b8f-c8bf-4af9-969b-a0bc4dd4dcad.zip" scope="external">FeatMngrExample.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-3bc38b8f-c8bf-4af9-969b-a0bc4dd4dcad.html" scope="peer">browse</xref> to view the example code.</p> </section> |
|
18 <section><title>Purpose</title> <p>The example shows how to use the <xref href="GUID-0CA63AEB-9A80-51C6-AE7F-E747D6B3B789.dita">Feature Manager</xref> API. |
|
19 UI vendors and device manufacturers can use this API to declare features (such |
|
20 as DRM agents, codecs, vibra) as available or not. The feature set can be |
|
21 adjusted dynamically as software services are installed and uninstalled or |
|
22 as platform capabilities are discovered dynamically. </p> <p>This example |
|
23 shows how Feature Manager APIs allow applications and system software to establish |
|
24 which features are present on or absent from a Symbian OS device. </p> </section> |
|
25 <section><title>Design and implementation</title> <p>The example consists |
|
26 of two processes: </p> <ul> |
|
27 <li id="GUID-0DA213CD-55C2-5ADD-A872-20D008EE5D46"><p> <filepath>featmngrexample.exe</filepath>: |
|
28 this is the main process which provides the list of available features. It |
|
29 also provides the option to add new features or delete/update a feature. </p> </li> |
|
30 <li id="GUID-B2A151CA-3807-5990-B431-CF4083E42107"><p> <filepath>featurechecker.exe</filepath>: |
|
31 this process receives notification about new features installed or uninstalled |
|
32 by the main process. </p> </li> |
|
33 </ul> <p><b>FeatMngrExample</b> </p> <p>This shows the use of the <xref href="GUID-F6AAAC24-4A62-383A-86C6-2E46335C3FD4.dita"><apiname>RFeatureControl</apiname></xref> API |
|
34 to manage features. </p> <p>It presents menu options to the user to list the |
|
35 available features, to add or delete a feature, update an existing feature, |
|
36 and to enable or disable a feature. It also starts another process, called |
|
37 featurechecker.exe which receives notifications of events happening in this |
|
38 process. The list of features includes some whose feature flags are non-modifiable. |
|
39 Any attempt to modify or delete those features will result in a system error |
|
40 -21 (<codeph>KErrAccessDenied</codeph>). When adding a new feature, it should |
|
41 be in the range as described in the console because the featurechecker process |
|
42 subscribes to this range of features for change notification. </p> <p><b>FeatureChecker</b> </p> <p>This |
|
43 process is started by <filepath>featmngrexample.exe</filepath>. It implements |
|
44 the <xref href="GUID-623C4183-00F0-36B0-AE1F-5C5EDCAF1B3D.dita"><apiname>MFeatureObserver</apiname></xref> class to handle notification of feature |
|
45 changes. <codeph>FeatureChecker</codeph> also demonstrates the use of the <xref href="GUID-CA12C6F7-E997-33B8-9463-B326BC1832C5.dita"><apiname>CFeatureNotifier</apiname></xref> class. |
|
46 It implements <codeph>HandleNotifyChange()</codeph> to handle the changes |
|
47 made by FeatMngrExample. The type of change is displayed to the user as an |
|
48 infoprint message (<xref href="GUID-C197C9A7-EA05-3F24-9854-542E984C612D.dita#GUID-C197C9A7-EA05-3F24-9854-542E984C612D/GUID-EEF84AA0-A277-390D-BFAB-CF50C94DF18D"><apiname>User::InfoPrint()</apiname></xref>). <codeph>HandleNotifyChange()</codeph> is |
|
49 called to handle changes for those features which are subscribed to for notification |
|
50 (in the <codeph>NotifyFeatureL</codeph> () method). </p> </section> |
|
51 <section><title>Building and configuring</title> <p>To build the example: </p> <ul> |
|
52 <li id="GUID-A8030260-4FEF-55E1-A50C-65BEE3F08E21"><p>The example builds two |
|
53 executables called <filepath>featmngrexample.exe</filepath> and <filepath>featurechecker.exe</filepath> in |
|
54 the standard locations. The second executable is run by the first. </p> </li> |
|
55 <li id="GUID-DD5D4965-A174-553C-BD13-22A6DFE9E52F"><p>You can build the example |
|
56 from your IDE or the command line. </p> <p>If you use an IDE, import the <filepath>bld.inf</filepath> file |
|
57 of the example into your IDE, and use the build command of the IDE. </p> <p>If |
|
58 you use the command line, open a command prompt, and set the current directory |
|
59 to the source code directory of the example. You can then build the example |
|
60 with the SBSv1 build tools with the following commands: </p> <p><userinput>bldmake |
|
61 bldfiles</userinput> </p> <p><userinput>abld build</userinput> </p> <p><xref href="GUID-793A5EF9-CC16-5EEB-9011-6431EA76EB15.dita">How to use bldmake</xref> and <xref href="GUID-B6B54E07-3B34-5D5C-8815-93383FA8FB4B.dita">How to use abld</xref> describe |
|
62 how to use the SBSv1 build tools. </p> </li> |
|
63 </ul> </section> |
|
64 <section><title>Running the example</title> <p>When running the example, the |
|
65 user is presented with various menu options that are self-explanatory. Press |
|
66 any other key to exit. </p> </section> |
|
67 <section id="GUID-433F7103-5372-5971-85A6-0FBF88ECE5C1"><title>See also:</title><p><xref href="GUID-7495B1C8-38B5-5A09-8231-25B3BBC09F51.dita">Feature Management</xref></p></section> |
|
68 </conbody></concept> |