×
Namespaces

Variants
Actions

获得感应器的数量

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
hoolee 在 11 Jul 2008 创建
最后由 hamishwillee 在 15 Dec 2011 编辑

CS000886


设备, 软件 版本: S60 3rd Edition, FP1


  • 详细描述

下列示例代码演示了如何获得可用的感应器的数量(例如,Nokia N95 8GB上的两个:加速感应器和旋转感应器)


注意:为了使用这段代码,你需要安装sensor plugin到SDK中


下列代码自签名即可执行

MMP文件

需要下列链接库

LIBRARY  RRSensorApi.lib


源文件

#include <RRSensorApi.h>RArray<TRRSensorInfo> sensorList;
CleanupClosePushL(sensorList);
 
// Retrieve list of available sensors
CRRSensorApi::FindSensorsL(sensorList);
 
// Get number of sensors available
TInt sensorCount = sensorList.Count();
 
CleanupStack::PopAndDestroy(); // sensorList
This page was last modified on 15 December 2011, at 08:50.
75 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.

×