# WearOS watches: faces only, or data apps?

**URL:** <https://discourse.processing.org/t/wearos-watches-faces-only-or-data-apps/45438>\
**Category:** Processing for Android\
**Created:** [December 7, 2024, 5:25am UTC](https://discourse.processing.org/t/wearos-watches-faces-only-or-data-apps/45438 "2024-12-07T05:25:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/joshg/32/20226_2.png) [@joshg](https://discourse.processing.org/u/joshg)\
**Post date:** [December 7, 2024, 5:25am UTC](https://discourse.processing.org/t/wearos-watches-faces-only-or-data-apps/45438/1 "2024-12-07T05:25:11Z")

</div>

I’m trying to sort out what’s possible before dropping money on an expensive smartwatch. Can Processing for Android create data collection apps that run in the background on a WearOS watch, eg. to track heart rate data without using Samsung’s proprietary service? Or are we limited to watch faces only (which I’m assuming are only running when the watch face is visible)?

---

<div class="post-metadata">

**Author:** ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)\
**Post date:** [December 9, 2024, 2:04pm UTC](https://discourse.processing.org/t/wearos-watches-faces-only-or-data-apps/45438/2 "2024-12-09T14:04:32Z")

</div>

Hi @joshg and welcome to the forum!

_Edit: [**Health Services on Wear OS**](https://developer.android.com/health-and-fitness/guides/health-services) look like a potential solution for getting the data you want._

I’m not an expert and have had no first-hand experience with developing for WearOS, but here’s some information I gathered that I hope will be helpful.

There is a `wearAmbient()` function that detects whether the watch is in ambient mode (battery saving) or not, allowing the sketch to update the graphics accordingly.

About getting the data you’re looking for, the [new Processing for Android book](https://www.amazon.com/Processing-Android-Create-Sensor-aware-Applications/dp/1484295846) by @Andres contains a whole chapter on visualizing data from Body Sensors.

The code examples for the book are [available on GitHub](https://github.com/Apress/Processing-for-Android-Second-Edition) in case you want a closer look. The code for visualizing physical activity is in Chapter 12. [This example](https://github.com/Apress/Processing-for-Android-Second-Edition/blob/ee97534a030e48fbaf6de400f4b16ddcbfbab0a4/chapter%2012/listing_12_5/listing_12_5.pde#L29) in particular includes the following code:

```auto
if (wearAmbient()) {
    fill(255);
    text(bpm + " bpm", 0, 0, width, height);     
  } else {
    int duration = 750;
    if (0 < bpm) duration = 60000 / bpm;
    float x = millis() % duration;
    float k = 1/(0.25 * duration);
    float a = impulse(k, x);
    float r = map(a, 0, 1, 0.75, 0.9) * width;    
    translate(width/2, height/2);
    fill(247, 47, 47);
    ellipse(0, 0, r, r);
  }

```

This seems to imply you can continue to get the BPM data while the watch is in battery saving “ambient” mode with the watch face showing a more minimalist version of the data, like in the following image:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/8/6/86b1370bbab0643dcdba0546de314f24be7f9628.jpeg)

However the book doesn’t mention getting the data in the background with the watch face not visible. If that is a Samsung-specific API, you might have to look at their own documentation.

️ **Important Note:** Watch face support in Processing for Android currently needs significant updates. The examples above may only work on WearOS 3.x because Google introduced [a new watch face format](https://android-developers.googleblog.com/2023/05/introducing-watch-face-format-for-wear-os.html) in WearOS 4, and older formats are being [deprecated starting with WearOS 5](https://support.google.com/wearos/thread/284572445). If you’d like to help upgrade Processing for Android to support the new format, please reply to [this issue on GitHub](https://github.com/processing/processing-android/issues/766)! New contributors are welcome 😊

---

<div class="post-metadata">

**Author:** ![joshg](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/joshg/32/20226_2.png) [@joshg](https://discourse.processing.org/u/joshg)\
**Post date:** [December 10, 2024, 12:07am UTC](https://discourse.processing.org/t/wearos-watches-faces-only-or-data-apps/45438/3 "2024-12-10T00:07:36Z")

</div>

Thanks, this looks like exactly the info I needed to know! Now to see what watch I can get a good enough deal on …
