icon_android Android

The barometer sensor measures the ambient air pressure. Barometer can be leveraged to detect and predict short team changes in weather, for example drops in pressure indicate rain, while raises indicate good weather ahead.

Public functions

  • Barometer.getFrequency( Context context ): returns sampling rate in Hz.

Settings

  • Aware_Preferences.STATUS_BAROMETER: true or false to activate or deactivate sensor.
  • Aware_Preferences.FREQUENCY_BAROMETER: non-deterministic frequency in microseconds (dependent of the hardware sensor capabilities and resources), e.g., 200000 (normal), 60000 (UI), 20000 (game), 0 (fastest).

aware-broadcasts

  • Barometer.ACTION_AWARE_BAROMETER: new data recorded in provider.
    • Barometer.EXTRA_DATA: the recorded data, as ContentValues.
  • Barometer.ACTION_AWARE_BAROMETER_LABEL: assign label to the recorded data.
    • Barometer.EXTRA_LABEL: the desired label.

aware-providers

Barometer Sensor

Contains the hardware sensor capabilities in the mobile device.

Barometer_Sensor.CONTENT_URI
content://com.aware.provider.barometer/sensor_barometer

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

Barometer Data

Contains the raw sensor data.

Barometer_Data.CONTENT_URI
content://com.aware.provider.barometer/barometer

Table field Field type Description
_id INTEGER primary key, auto incremented
timestamp REAL unixtime milliseconds since 1970
device_id TEXT AWARE device UUID
double_values_0 REAL the ambient air pressure in mbar/hPa units (depends on hardware)
accuracy INTEGER Sensor’s accuracy level (see SensorManager)
label TEXT Customizable label. Useful for data calibration or traceability

 


icon_ios iOS

The barometer sensor measures the ambient air pressure same as Android. Barometer can be leveraged to detect and predict short-term changes in weather, for example, drops in pressure indicate rain, while raises indicate good weather ahead.

CMAltimeter Class in CoreMotion Framework provides the air-pressure data on iOS.

aware-broadcasts

  • Barometer.ACTION_AWARE_BAROMETER: new data recorded in provider.
    • Barometer.EXTRA_DATA: the recorded data, as ContentValues.

aware-providers

Barometer Data

 

Table field Field type Description
_id INTEGER primary key, auto incremented
timestamp REAL unixtime milliseconds since 1970
device_id TEXT AWARE device UUID
double_values_0 REAL the ambient air pressure in mbar/hPa units (depends on hardware)
accuracy INTEGER This column is not supported on iOS
label TEXT Customizable label. Useful for data calibration or traceability
Barometer