WearOS watches: faces only, or data apps?

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)?

Hi @joshg and welcome to the forum!

Edit: Health Services on Wear OS 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 by @Andres contains a whole chapter on visualizing data from Body Sensors.

The code examples for the book are available on GitHub in case you want a closer look. The code for visualizing physical activity is in Chapter 12. This example in particular includes the following code:

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:

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 in WearOS 4, and older formats are being deprecated starting with WearOS 5. If you’d like to help upgrade Processing for Android to support the new format, please reply to this issue on GitHub! New contributors are welcome :blush:

1 Like

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

2 Likes