Search code examples
servicebackgroundwifiwear-os

Can I run a service in the background on Wear OS, constantly sending heart rate data via WiFi/LTE?


Is it possible on Wear OS to constantly record heart rate data and/or other sensor data in the background and send it via WiFi/4G without a phone?

Can such a service start on boot?


Solution

  • Yes - but if long lived you must use passive updates to get batched data, otherwise you will likely ruin battery life.

    https://developer.android.com/training/wearables/health-services

    https://developer.android.com/training/wearables/health-services/passive

    You can request an LTE or Wifi network to sned data when you have enough to send. But you shouldn't try to keep the network open permanently.