Looking for additional info on ConnectIQ native functions

Former Member
Former Member
Hi Connectors,

Does anyone know where I can get additional information (beyond what is in the SDK docs, the API ref., and the empty placeholder functions in the sample code) on ConnectIQ native functions?

For example:

When a new watch face project is created, we get two files: *App.mc and *View.mc. Between these two files there are several functions: onStart(), onStop() to name a couple. Well, when the new project is created, these functions are presented as having no parameters and no code in the body, yet the API docs define them both as requiring a Dictionary object as a parameter.

I just feel like some important data is being left out of the documentation and there is too much obfuscation going on. Anyone else get this feeling?

Thanks,
Jeff
  • The parameter to onStart() and onStop() was supposed to be a dictionary that you could use to save off application state. The docs from the 1.1.4 SDK...

    - (Object) onStart(state)

    Before the initial WatchUi.View is retrieved, onStart() is called. This is where app level settings can be initialized or retrieved from the object store before the initial View is created. It is also possible to be given a dictionary of state data, indicating that the app was previously closed with the intention of allowing it to return to its previous state. The state parameter may be null, indicating that the app was previously fully stopped.

    Parameters:
    • state (Dictionary) — A Dictionary of values to allow resuming from a previous state


    Since:
    1.0.0


    and

    - (Object) onStop(state)

    When the system is going to terminate an application, onStop() is called. If the application needs to save state to the object store it should be done in this function. If the state parameter is not null, then the app is being suspended with the intention of starting again. This allows for the app to be restored to its previous state. This state is separate from the object store in that this data will only be available if the app is resumed.

    Parameters:
    • state (Dictionary) — A Dictionary to store the current app state

    Since:
    1.0.0


    The functionality is in the process of being removed (the 1.2.2 release removed some of the relevant menu items from the simulator).
  • Former Member
    Former Member over 9 years ago
    The functionality is in the process of being removed (the 1.2.2 release removed some of the relevant menu items from the simulator).


    Do I infer from this: "Don't worry about this soon-to-be-deprecated functionality"?

    Thanks,
    Jeff
  • Do I infer from this: "Don't worry about this soon-to-be-deprecated functionality"?

    Thanks,
    Jeff


    Yes, that is how I'd interpret it. One of the Garmin guys may come along with more information, but this is the gist of what has been communicated to me.
  • Former Member
    Former Member over 9 years ago
    Works for me. Thanks!
  • That documentation should have been removed. I've removed it so the API documentation will be updated with the next release.