Datafield Context/Awareness

I write data fields that adapt to the size of the field. For example, if you assign it to a full screen you get a richer set of data than if you assign it to one of many smaller fields on the screen.

What would be nice is for the data field to have awareness of what profile it is on. Road, Gravel, Mountain Bike, Indoors. I know you can override the name of the profile But most leave these defaults and some services, like Strava, use those names to do things like automatically assign bikes to the activities to track mileage, etc.

Also, the position of the data field is valuable. For example, if you assign the data field to two different fields on a screen, it could display two different sets of data being position dependent.

As far as I know, a data field has no ability to discern the active profile or it's position on the screen.

  • For profile info, see Activity.ProfileIndo.sport/subsport

    There's no way to know if you are running in the first field, 2nd etc where the Dc is the same size and the obscurity flags are the same.  What is commonly done is to publish multiple copies of your DF with different manifest IDs,  (MyDF1,MyDf2, etc)

  • For example, if you assign the data field to two different fields on a screen

    I wonder how that actually works in terms of app "instances" / memory consumption. (Here when I say "instance", I mean a distinct instantiation of the app with its own memory and its own "control flow" wrt to compute(), onUpdate(), etc., analogous to a distinct process on other platforms)

    For example almost every CIQ watch is limited to 2 CIQ fields per activity, but at least on 945 LTE, you can seemingly add the same CIQ field to an activity as you want, without the extra copies counting against the limit.

    That suggests to me that all the multiple uses of the same CIQ field are a single "instance" with shared memory and control flow, and that there would be no way to display different information for different uses. I wonder what that would look like to the field's single "instance" (assuming it only is one "instance"). Would onLayout() be called multiple times or just once? What would getObscurityFlags() return? (Yeah I could check these assumptions / guesses with a sideload but I probably won't do it today.) I think I may have tried this a long time ago on 935, and IIRC, compute() and onUpdate() were only called once per second no matter how many times the field was added to the same activity.

    On the flip side, if every usage of the same CIQ field was a separate "instance", it seems like each one would count against the data field limit.

    You could try to confirm either hypothesis (single or separate "instances" for multiple usages) by making an app that displays the system uptime/clock in milliseconds, captured at onStart(). If it's multiple "instances", it seems like each usage of the app would display a slightly different starting uptime. If it's a single "instance", I would expect to see the same starting uptime for each usage.