Beginner, stuck after development of App

Hi All

Do I have come to the point where I would like to test my App on a real device.

My App is running fine in the simulator.

I'm using visual studio on mac.

I have tried to select "Monkey C :Build for device" - and I select the folder where my application is.
In Terminal it says "BUILD SUCCESFULL".

But I have no idea where to go from here, and I can't really find any documentation.

Maybe it's something about getting the .PRG file to the garmin, but how do I do that now i does hot handle file management ?

I can't upload anything to IQ either, seems i'm missing a IQ file.
Any documentation or even better examples would be appriciated.

Thanks
Ulrik

  • Maybe it's something about getting the .PRG file to the garmin, but how do I do that now i does hot handle file management ?

    What the FAQ doesn't mention at all:

    Since you are on Mac, you most likely need to use 3rd-party software such as openmtp to transfer files to and from your Garmin device. Make sure Garmin Express is completely closed first (you also have to close the Garmin icon in the menu bar)

    (Most newer Garmin devices use MTP instead of USB Mass Storage to transfer files.)

    Other than that (some of this is in the FAQ):

    Using the simulator

    - To build for the simulator: Command Palette (CMD-SHIFT-P) > "Monkey C: Build Project"

    - To run in the simulator (run with debugging): Fn-F5

    - To run in the simulator (run without debugging): Fn-CTRL-F5

    Notes:

    - Sometimes you have to press Fn-F5 or Fn-CTRL-F5 multiple times to get the simulator to launch. it's very flakey

    - "Monkey C: Build Project" will always prompt you to choose a device

    - When you run with or without debugging, the project is automatically rebuilt if necessary (almost the same as if you manually selected "Monkey C: Build Project" except you're not always prompted to choose a device)

    - Run (with or without debugging) will normally only prompt you for a device the first time after you restart VS Code. If you want it to prompt you for a device every time, create a launch.json file

    --

    Testing on the device (without using the CIQ store)

    - To build for a sideload (to copy to the device): Command Palette > "Monkey C: Build For Device" 

    - To sideload to the device: Copy the PRG file built by "Build For Device" to /GARMIN/APPS on your device

    --

    Building for the CIQ store

    - To build an IQ file for the Connect IQ store: Command Palette > "Monkey C: Export Project"

    (an IQ file is just a ZIP file, so you can look inside it with any tool that supports ZIP files. You *may* have to rename it first)

  • You might know this, but it is often really helpful during development to create a LOG file on your device to capture console println output on the real device. It is also tricky to create using the (new for some devices) MTP mount method. What seems to work best for me is to create the empty LOG file on your computer and copy/paste it into the device's folder. The NAME of the PRG is also a pain, as it can change. But for device builds it is a little easier. If you know all this, great. If you have questions about how to do this, let us know.

  • Thanks guys, I used your suggestions and got a lot further.

    Installing Android Filetransfer actually helped a lot. I don't need to use IQ Connect then.

    Unfortunately only to discover the Garmin cannot run an App while an activity is happening.
    My idea was to develop an App helping with nutrition on the bike....

    Now I guess i have to look into datafield instead and see how much that can do.
    Can I make a datafield that more or less covers the hole screen ?

    Thanks again
    Ulrik


  • Yes you can make a CIQ datafield that uses the whole screen. You will have to implement a "complex" data field, which handles drawing itself. Simple data fields just return a value (e.g. string or number) and the system takes care of the rendering. 

    But typically [*] it's up to the user to add your data field to a page with a 1 field layout. The data field itself cannot enforce this.

    This type of CIQ data field was so popular in the beginning that Garmin's support article for adding CIQ fields tells users to change the data page layout to 1 field, whether or not the CIQ field actually needs that.

    [*] Current Garmin watches (like FR255 / FR955 / Fenix 7 and newer) have a new automatic set up process for CIQ data fields. After the user installs a data field from the store, the watch prompts them to select activities to add it to. For each of the selected activities, the watch automatically adds a new page with a 1-field layout and assigns your data field to it.

    Some various kinds of CIQ data fields I've seen:

    1) Optimized for smaller layout (if you use 1-field layout, it's not unusable, but the field doesn't use the whole screen) (most CIQ data fields - every "simple" data field is like this).

    2) Only works properly with 1-field layout (if the user sets another layout, it just looks bad and is mostly unusable - most of the information is cut off) (e.g. Dozen Run)

    3) Automatically adapts to 1-field layout or smaller layout (e.g. Stryd Zones)

    To determine whether your complex data field is being displayed on a 1-field layout or not, you can look at the size of the data field DC in onUpdate - if it's the same as the device display, then the field must be in a 1-field layout.

  • Thanks All.
    I ended up creating an extended datafield, which works perfect (Still lot to learn).
    I have tried to create some setting to use, but after I upload my project ti connect IQ I don't see the settings available in the app.

    I read and old thread about not being able to see settings, if app was uploaded in developer/meta mode, is that still valid.

    I have create a settings.xml (below) and properties.xml (also below)
    Should I do anything else ? Any good documentation about this ?

    Ulrik


    <settings>
    <setting propertyKey="@Properties.useUserId" title="Use user ID in URL">
    <settingConfig type="boolean"/>
    </setting>

    <setting propertyKey="@Properties.userId" title="User ID" prompt="User ID">
    <settingConfig type="alphaNumeric" required="false"/>
    </setting>

    <setting propertyKey="@Properties.alarmSeconds" title="Alarm duration (seconds)" default="5">
    <settingConfig type="list">
    <listEntry value="5">5</listEntry>
    <listEntry value="7">7</listEntry>
    <listEntry value="10">10</listEntry>
    <listEntry value="12">12</listEntry>
    <listEntry value="15">15</listEntry>
    <listEntry value="20">20</listEntry>
    </settingConfig>
    </setting>
    </settings>
    <?xml version="1.0" encoding="UTF-8"?>
    <resources>
    <properties>
    <!-- Defaults live here -->
    <property id="useUserId" type="boolean">false</property>
    <property id="userId" type="string"></property>
    <property id="alarmSeconds" type="number">10</property>
    </properties>
    </resources>
  • I read and old thread about not being able to see settings, if app was uploaded in developer/meta mode, is that still valid.

    Yes settings should be available for apps uploaded to the Connect IQ store, including beta apps (provided the apps implement them, of course).

    Do you see settings in the sim? File > Edit Persistent Storage > Edit Application.Properties Data

    Also, I assume you are aware that settings defined this way (in resources) are "off-device" settings which are set in the Connect IQ phone app or Garmin Express.

    If you are expecting to see settings on the watch, you need to implement your own UI and code for persisting data. For data fields and watch faces, the view which implements all of this should be returned by getSettingsView() in your app class. 

    For device apps, you ofc can push any view you want (which can accept all kinds of input), so you can implement your own settings view that way. (e.g. if the user presses the menu shortcut, which is a long press of the UP button for 5-button watches, you could push your settings view then. Or your settings view could be triggered when the user selects an item in a menu.)

  • Thanks for the prompt reply.
    I'm expecting to see the settings in the Connect IQ app only, not on the Edge1040 i'm developing for.

    I was not aware I could check the settings in the simulator - great and thangs for that update.

    I Don't see them there, probably I have not define them correctly ?

    Is there somewhere else I need to setup the datafield having properties / settings ?
    I don't see anything in the Manifest.xml for this.

  • It doesn't say anything that you or I haven't already said:

    - to test settings in Garmin Express or the Connect IQ phone app, you have to upload your app to the store (even as a beta)

    - you can also test settings in the simulator