×
Namespaces

Variants
Actions
Revision as of 18:43, 7 September 2009 by savaj (Talk | contribs)

How to know features supported

From Nokia Developer Wiki
Jump to: navigation, search
{{{width}}}

CFeatureDiscovery class is used to query which features are suppported in the platform/environment. A feature is functionality that can be optionally left out of some product configurations. Features often depend on the underlying hardware. For example, MMC support or USB support can be features. The API consist of the CFeatureDiscovery class which is used together with feature IDs defined in the featureinfo.h header file.


#include <FeatDiscovery.h>
#include <featureinfo.h> // for feature definitions
 
TBool isSupported = CFeatureDiscovery::IsFeatureSupportedL(KFeatureIdUsb);
TBool isIRAvailable = CFeatureDiscovery::IsFeatureSupportedL( KFeatureIdIrda );
TBool isBTAvailable = CFeatureDiscovery::IsFeatureSupportedL( KFeatureIdBt );

If querying only one feature, it is more efficient to use the class via the static method, IsFeatureSupportedL(). When querying more than one feature, it is more efficient to use the class by creating an instance and calling the IsSupported() method as follows.

//Call NewL() to create an instance of CFeatureDiscovery. 
CFeatureDiscovery* testA = CFeatureDiscovery::NewL();
 
// Call the exported IsSupported() method to query whether features
// are supported in the current environment or not.
TBool usbSupported = testA->IsSupported(KFeatureIdUsb);
TBool mmcSupported = testA->IsSupported(KFeatureIdMmc);
 
// Delete the created instance of CFeatureDiscovery.
delete testA;
46 page views in the last 30 days.
×