To use this API, create a project with the target platform Custom. You must select MIDP 2.0 or higher and CLDC 1.1 before you can select the Mobile Sensor API optional package.
To set permissions, click the Settings button and choose the Permissions icon.
A sensor project freely detects sensors, but this does not imply you can get data from the sensors you find. You might need to explicitly set permissions in your project so you can interact with certain sensors.
The following permissions work with the preconfigured embedded sensors shipped with the SDK:
Required to open a sensor connection and start measuring data.
Required to access a protected sensor.
Required to access a private sensor.
A sensor is private or protected if the sensor’s security property has the value private or protected. The security property is an example of a sensor property you might create for yourself in your own sensor configuration. You can create your own optional properties using com.sun.javame.sensorN.proplist and com.sun.javame.sensorN.prop.any_name, where N is the sensor number and any_name is the name of your property. The security sensor property was created as follows:
# add security into proplist com.sun.javame.sensor<N>.proplist: security # add security property value com.sun.javame.sensor<N>.prop.security: private