Skip to main content

Other Data Sources

Battery

Supported in Android & iOS.

This data source monitors the battery status of the device. The battery data source has three unique features:

  • Unlike other data sources which can be unavailable on certain devices (e.g. smartphones without accelerometer), almost all devices are shipped with batteries. That guarantees that regardless of device type, this data will be available.
  • Unlike some data sources such as GPS where the user can turn off the sensor manually, the battery data source cannot be turned off.
  • Avicenna guarantees that in each operation cycle, it reads exactly one battery record.

These features allow us to infer certain information from battery data. First and foremost, battery data provide information on the charging, discharging, and power consumption of the device. This allows us to measure how fast the battery drains, and how often the participant has to charge their device.

Additionally, as Avicenna guarantees exactly one battery record per operation cycle, this data can clearly show for how long the app was operational and how long it was not, for reasons such as the device being turned off or the app being stopped explicitly.

Furthermore, the battery data can be combined with data from other sources to assist behavioral analysis. For example, if the phone is plugged into the wall, we can be almost certain that the person was not carrying the device, and therefore any activity readings during that period should be treated with caution.

Each battery record includes the following:

Level: Current battery level, from 0 to Scale. Internally stored as level.

Scale: Maximum battery level. Internally stored as scale.

Plugged: Whether the device is plugged or not. It can contain one of the following values:

  • 0 indicating the device is on battery.
  • 1 indicating the current power source is AC.
  • 2 indicating the current power source is USB.
  • 3 indicating the current power source is wireless.

Internally stored as plugged.

Status: Status of the battery with respect to charging. It can be one of the following values:

  • 1 the battery status is unknown.
  • 2 the battery status is charging.
  • 3 the battery status is discharging.
  • 4 the battery status is not charging.
  • 5 the battery status is full.

Internally stored as status.

Temperature: Shows the current battery temperature in tenths of celsius. Android only. iOS records will always store 0. Internally stored as temperature.

Voltage: The current battery voltage level in millivolt. Android only, iOS records will always store 0. Internally stored as voltage.