×
Namespaces

Variants
Actions

How to know features supported

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: polaka_sr (11 Dec 2007)
Last edited: hamishwillee (30 May 2013)

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;
This page was last modified on 30 May 2013, at 07:34.
51 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×