AlloyJS WatchFace and Health Data

Hello all,

I am developping a watchface for Pebble Time 2 using Alloy framework.
I am trying to display a step counter but cannot find how to access health Data with Javascript framework.

I only find documentation about C code.

Is there a way to get the step count in an Alloy watchface ?

Thank you in advance for your answers.

Regards.

Nicolas.

3 Likes

Good question! @jpx I might have some tips on how to call C functions from inside an Alloy app.

1 Like

unfortunately I do not, sorry!

1 Like

Hello,

No problem. I am still looking for documentation.

I found this page : Moddable | Documentation | XS | XS in C

But I don’t really know what to do with that :sweat_smile:.

Regards.

Nicolas

1 Like

In conclusion, developers cannot use C code in Alloy app.

Because Alloy app implements this through a feature called mods, it cannot include native C code.
If you want to add an API that executes C code, you need to add a JavaScript API using XS in C to the host application on the PebbleOS side.

1 Like

OK,

If I understand well I can use XS in C to create a bridge between JavaScript and C code.

And I can do and build all of this in the same project.

Is that so ?

Regards,

Nicolas

1 Like

I definitely have to take the time to read that documentation.

Thank you for your help.

1 Like