Skip to content

Activity detection

Activity detection fills the activity field of each location. For the rest of the Location type, see Locations & history.

By default, activity is null. Set detectActivity = true in your config and Beekon labels each location with the device’s physical activity. It is off by default because it costs battery and needs a second OS permission.

When on, activity carries one of six values: Stationary, Walking, Running, Cycling, Automotive, Unknown. It stays null whenever detection can’t run: it is off, the permission isn’t granted, or (on Android) the device has no Google Mobile Services.

Beekon.configure(
BeekonConfig.Local(tracking = TrackingConfig(detectActivity = true))
)
Beekon.locations.collect { loc ->
Log.d("beekon", "moving as ${loc.activity ?: "—"}")
}

activity is also sent in the upload payload, on each locations[] entry. It is left out when detection is off.