Datafield with configuration - how to.

Hi,
I'm playing about with creating a couple of data fields.

I see that some of the apps/fields have configuration and this is set on the phone app and synced to the device (as I understand it).

I've taken a look through the Garmin docs, perhaps I'm missing it, but I can't see any guide of how to go about incorporating configurable settings into my datafield/app.

Could someone point me in the right direction?

Thx
Steve
  • Former Member
    Former Member over 9 years ago
    what about this:

    in settings/properties.xml:
    <properties>
    <property id="var1" type="number">1234</property>
    <property id="var2" type="number">5678</property>
    </properties>

    in settings/settings.xml:
    <settings>
    <setting propertyKey="@Properties.var1" title="@Strings.var1">
    <settingConfig type="numeric" />
    </setting>
    <setting propertyKey="@Properties.var2" title="@Strings.var2">
    <settingConfig type="numeric" />
    </setting>
    </settings>

    in strings/strings.xml:
    <strings>
    <string id="var1">Var 1 description to be shown</string>
    <string id="var2">Var 2 description to be shown</string>
    </strings>

    in your app you access the values like this:
    var xyz1 = Application.getApp().getProperty("var1");
    var xyz2 = Application.getApp().getProperty("var2");
  • Great thanks.

    All looking good...got the values out.

    Side loaded the data field onto my 920XT, all looks good...

    Going to my phone, Device -> Apps -> My App -> There is not a settings button!!?
  • Former Member
    Former Member over 9 years ago
    the simulator should allow you to test the settings.

    not sure sideloading the app to device would allow you to use the settings feature.

    try uploading the app to the ciq store and downloading the app from there to your device

    also you might want to try using garmin express instead of the phone.
  • It seems that side loading doesn't allow you to test settings, well, didn't for me!

    So, like you suggested, after giving it a little test in the emulator I just uploaded it!! Testing in production! Why not!
  • As you've found, you can't configure a side-loaded app from Garmin Connect Mobile or Garmin Express. You can generate the .SET file using the App Settings Editor, and then copy it into place.

    When you are ready to test app settings on a physical device, you can publish your app and put a note in the title/description to indicate you don't want the app to be approved yet (e.g., DO NOT APPROVE). If you do that, the app will appear in the store, won't get approved, and you can test app settings. Once you've tested app settings, you can remove the comment, and submit it again. Unfortunately this process doesn't work well for apps that are already in the app store. For those cases, you can create a test app that is never approved, and do all of your setting testing there.

    Travis
  • App settings rely on the app store to function, so side-loading will not let you test app settings on hardware (you can still side-load to test other app functionality). What I recommend at this point is to upload your app to the app store and note somewhere prominent (preferably the app title) "DO NOT APPROVE" so we will leave it in a pending state while you test it. Once you're satisfied, you can edit the app listing and we'll get it approved.

    In the future, we plan to have a beta status that developers can flag on their apps that will allow them to remain pending on the store without being considered for approval. This will give you more control over your app submissions during development and testing. Ideally, it will also allow you to have one version that is live, and have a second version queued up in 'beta' status for testing.
  • Please document this somewhere more prominent! This happens to every newbie trying to implement this. Cost me two hours of debugging before I searched the forum and found this thread.

    Better add this to http://developer.garmin.com/connect-iq/programmers-guide/resource-compiler/

    Thanks!
  • I must say this is really annoying
    why shouldn't i be able to fully test my app without using the app store?
  • Be sure and look though the new developer FAQ (there's a sticky). Point 10 show how to avoid a known bug with numbers, and others talk about testing. You can also copy the .set along with a sideload to try different things on a real device, and then when ready put it in the store but mark it as a beta so only you can download it.