Request: Communication permissions for datafields

I have a data field where I would like to draw in information via a JSON request.

But that does not seem to be possible: The compiler writes:

BUILD: ERROR: The following permission is invalid for a DATA_FIELD: Communications

I'm sure you have had your reasons (likely performance), but it would be really, really nice if we could do this knowing the disadvantages and restraining ourselves a bit :-)

There are a hole class of advanced social applications that will require this, I believe

Other permissions that cannot be used with data fields: Ant, FIT, Position and Sensor. Position I can understand as we already have access to the information in the compute method, but others?
  • See Monkey C Programmers Guide, p. 31 - Communications is not allowed for data fields. Same for others you mentioned.
    I'm not sure about FIT now, because in 1.0.0 version it is completely missing from the table. In the previous public version (0.2.4) it was mentioned for Apps.
    And for Position - do you need anything that you won't get from Activity.Info?
  • During an activity, the 920 is doing a lot of things, especially if you are using courses, the map, and those other "features" all the kids love. CIQ potentially adds two completely independent third party applications to join the party. There really isn't the resources to allow CIQ to go off and do lots of other things like use the BLE radio.

    Sometimes it's hard to be the Alpha Monkey. Everyone wants you to be API Oprah (You get an API! You get API! EVERYONE GETS APIs!), but usually I am API Debbie Downer.

    -Alpha Monkey
  • During an activity, the 920 is doing a lot of things, especially if you are using courses, the map, and those other "features" all the kids love. CIQ potentially adds two completely independent third party applications to join the party. There really isn't the resources to allow CIQ to go off and do lots of other things like use the BLE radio.

    Sometimes it's hard to be the Alpha Monkey. Everyone wants you to be API Oprah (You get an API! You get API! EVERYONE GETS APIs!), but usually I am API Debbie Downer.

    -Alpha Monkey


    I just laughed out loud. :)
  • During an activity, the 920 is doing a lot of things, especially if you are using courses, the map, and those other "features" all the kids love. CIQ potentially adds two completely independent third party applications to join the party. There really isn't the resources to allow CIQ to go off and do lots of other things like use the BLE radio.


    We already have small "windows" where the 920 connects via BLE to the phone - at least I see these every 5-10 minutes when I run. So an alternative would be to add a callback akind to the following - and then maybe do it a little more often :D

    using Toybox.Communications as Comm;

    class Example {
    function initialize() {
    Comm.enableBLEEvents(:onBLEEvent)
    }
    function onBLEEvent(state) {
    if (state == Comm.BLE_AVAILABLE) {
    ...
    Comm.makeJsonRequest(url, request, options, :onResponse);
    } else if (state == Comm.BLE_NOT_AVAILABLE) {
    ...
    } else {
    ...
    }
    }
    function onResponse(responseCode, data) {
    if (responseCode == Comm.BLE_REQUEST_CANCELLED) {
    // BLE Window closed...
    }
    }
    }
  • During an activity, the 920 is doing a lot of things, especially if you are using courses, the map, and those other "features" all the kids love. CIQ potentially adds two completely independent third party applications to join the party. There really isn't the resources to allow CIQ to go off and do lots of other things like use the BLE radio.

    Sometimes it's hard to be the Alpha Monkey. Everyone wants you to be API Oprah (You get an API! You get API! EVERYONE GETS APIs!), but usually I am API Debbie Downer.

    -Alpha Monkey


    Seriously great sense of humor there. Keep up the good work.
  • Hi all,

    Sorry for bumping this old topic but I have the same request here: Use the comm API for datafields.

    This can be useful for two things:
    - store a huge dataset on the smartphone and send only a piece of them to the watch
    - send a long computation process to the smartphone and obtain a simple result.

    Thanks!
  • Since 2.3.0 (April 2017), data fields can do comm in a background process. It's the same concept as doing comm in a watchface.

    Here's a Blog Post with the basics of backgrounding.
  • Ok, thx for this information.
    Unfortunately, as you mention: it's since 2.3.0 and so it's working neither with my 920xt nor my 235