Acknowledged

dataField Toybox.Timer crashes app

I've to use a timer to send a bluetooth keepalive write every 300ms.

I'm trying to create a timer in my Application.AppBase class but when doing that the simulator crashes.

        self.mTimer = new Timer.Timer();
        self.mTimer.start(self._deviceManager.method(:tick), 300, true);

Furthermore it seems 4.1.6 introduced strict typing but documentation isn't updated to correspond to this.
Sample code in https://developer.garmin.com/connect-iq/api-docs/Toybox/Timer/Timer.html gives typing errors.

Parents
  • But I'm extending Application.AppBase which is an Application which would imply Watch App

    Incorrect. All Connect IQ app types have a main class which extends Application.AppBase. The different types of apps are:

    - watch app / device app
    - widget
    - watch face
    - data field
    - audio content provider

    The actual type of your app is determined by the iq:application.type property in manifest.xml, which is automatically set when you create a new project using the VS Code or Eclipse CIQ extension.

    e.g.

    <iq:application entry="SimpleDataField" id="..." launcherIcon="@Drawables.LauncherIcon" minSdkVersion="1.2.0" name="@Strings.AppName" type="datafield">

Comment
  • But I'm extending Application.AppBase which is an Application which would imply Watch App

    Incorrect. All Connect IQ app types have a main class which extends Application.AppBase. The different types of apps are:

    - watch app / device app
    - widget
    - watch face
    - data field
    - audio content provider

    The actual type of your app is determined by the iq:application.type property in manifest.xml, which is automatically set when you create a new project using the VS Code or Eclipse CIQ extension.

    e.g.

    <iq:application entry="SimpleDataField" id="..." launcherIcon="@Drawables.LauncherIcon" minSdkVersion="1.2.0" name="@Strings.AppName" type="datafield">

Children
No Data