This page was last modified 08:39, 7 April 2008.
CS000886 - Obtaining the number of sensors
From Forum Nokia Wiki
| ID | CS000886 | Creation date | April 7, 2008 |
| Platform | S60 3rd Edition, FP1 | Tested on devices | Nokia N95 8GB |
| Category | Symbian C++ | Subcategory | Hardware, Sensors |
| Keywords (APIs, classes, methods, functions): CRRSensorApi, TRRSensorInfo, CRRSensorApi::FindSensorsL() |
Overview
This snippet demonstrates how to obtain the number of available sensors on your device (for example, two on the Nokia N95 8GB: accelerometer sensor and rotation sensor).
Note: In order to use the code, you need to install the sensor plugin for your SDK.
This snippet can be self-signed.
MMP file
The following libraries are required:
LIBRARY RRSensorApi.lib
Source file
#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
Postconditions
The number of available sensors is obtained.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create flooder | purple-boy | Python | 12 | 2008-05-07 21:53 |
| how to find out phone number programmatically in j2me | scheung3 | Mobile Java General | 1 | 2004-06-09 00:38 |
| Installing Series 60 MIDP SDK 1.2.1 for Symbian OS, Nokia Edition | parkinm | Mobile Java Tools & SDKs | 3 | 2006-04-21 13:09 |
| Nokia_S40_DP20_SDK_6230i serial number | peteswiftuk | Mobile Java Tools & SDKs | 2 | 2006-07-10 20:57 |
| NDS for MMS serial number | Nokia_Archive | General Messaging | 4 | 2008-08-12 20:11 |

