The proximity sensor measures the distance to an object in front of the mobile device. Depending on the hardware, it can be in centimeters or binary.
Public functions
- Proximity.getFrequency( Context context ): returns the sampling rate in Hz.
Settings
- Aware_Preferences.STATUS_PROXIMITY: true or false to activate or deactivate sensor.
- Aware_Preferences.FREQUENCY_PROXIMITY: non-deterministic frequency in microseconds (dependent of the hardware sensor capabilities and resources), e.g., 200000 (normal), 60000 (UI), 20000 (game), 0 (fastest).

- Proximity.ACTION_AWARE_PROXIMITY: new data recorded in provider.
- Proximity.EXTRA_DATA: the recorded data, as ContentValues.
- Proximity.ACTION_AWARE_PROXIMITY_LABEL: assign label to the recorded data.
- Proximity.EXTRA_LABEL: the desired label.

Proximity Sensor
Contains the hardware sensor capabilities in the mobile device.
Proximity_Sensor.CONTENT_URI
content://com.aware.provider.proximity/sensor_proximity
| Table field | Field type | Description |
|---|---|---|
| _id | INTEGER | primary key, auto incremented |
| timestamp | REAL | unixtime milliseconds since 1970 |
| device_id | TEXT | AWARE device UUID |
| double_sensor_maximum_range | REAL | Maximum sensor value possible |
| double_sensor_minimum_delay | REAL | Minimum sampling delay in microseconds |
| sensor_name | TEXT | Sensor’s name |
| double_sensor_power_ma | REAL | Sensor’s power drain in mA |
| double_sensor_resolution | REAL | Sensor’s resolution in sensor’s units |
| sensor_type | TEXT | Sensor’s type |
| sensor_vendor | TEXT | Sensor’s manufacturer |
| sensor_version | TEXT | Sensor’s version number |
Proximity Data
Contains the raw sensor data.
Proximity_Data.CONTENT_URI
content://com.aware.provider.proximity/proximity
| Table field | Field type | Description |
|---|---|---|
| _id | INTEGER | primary key, auto incremented |
| timestamp | REAL | unixtime milliseconds since 1970 |
| device_id | TEXT | AWARE device UUID |
| double_proximity | REAL | the distance to an object in front of the mobile device or binary presence (manufacturer dependent). |
| accuracy | INTEGER | Sensor’s accuracy level (see SensorManager) |
| label | TEXT | Customizable label. Useful for data calibration or traceability |
Proximity