On application configuration

What would be the most simple solution for a mostly static configuration?

My app will probably never be in the store so I guess syncing of properties through the Garmin app etc is not on table. The app will probably mostly appeal to a small set of nerds so I'm not looking at building configuration into the application. I would prefer to read a simple external json (or foo=bar format properties file) from the file system but understandably you can't access files just like that from an app. There is apparently a <appname>.SET file in the apps/settings folder but the format is binary so nothing the user could tinker with easily.

I've also considered reading the settings from a text message or fetching it from a url but that still sounds a bit like a hack. Is a  plain-text, external file like I dreamed of doable?

Thanks in advance,

  Nik

  • With a widget or device app, the easy thing to do is use menus/pickers right in the app itself.

    Have defaults, and if something changes, save it to Application.Storage.  When starting, read Storage and use that if the key exists.

  • My app will probably never be in the store so I guess syncing of properties through the Garmin app etc is not on table.

    Well, if it is just for you, you can set it up as a "Beta" upload and then the settings menus will work (mostly) with the Connect IQ / Connect / Garmin Express apps. (I say mostly because the "Connect" app is a bit unreliable in that.)

  • Sounds like it may be used by multiple people:

    "The app will probably mostly appeal to a small set of nerds so I'm not looking at building configuration into the application."

  • Then why not in the store? Are they all going to side load?

  • Could be something that based on the rules, can't be approved.

  • Yep, if I end up doing the custom radar stuff, people will probably have to sideload it (probably I'll just provide a github link to the prg-file and advertise it on local and national road bike groups if anyone is interested.

    Perhaps I'll make another fork which will pass regulation, that one will probably use standard configuration with in-app menus/settings. I might end up using that anyway since it would be common for both versions in any case.

  • How about this: your app generates a 6 digit random number, transmits it to your web site and shows it on the watch with the URL of your site. The user visits the web site enters the 6 digit number and then performs all the configuration required. Your app polls the site waiting to download the configuration as a json file.

  • That's on option. Another one I'm looking into is using Communications.registerForPhoneAppMessages and just have the user mail the config file to themselves and the app picks it up (if it has some magic token like appConfig=1 as the first line)

  • Although the registerForPhoneAppMessages theory was shut down since it's no longer supported on the Edge

  • Heh, how about 

    1. The user gets an account on e.g. pastebin (so you can edit your pastes) or github and creates their json file

    2. You go to tinyurl and make a forward to the raw json file with with a custom appendix /MyApp-<deviceId>

    3. At app start, a read is attempted to tinyurl

    Have to check if forward headers are honored in the web request. Sure, technically someone could guess your device id and look at your settings but they still couldn't edit them (and the information is mostly trivial values, limits etc).

    Edit: hey, it actually appears to work! Of course there is the problem if you want to change the forward then the tinyurl is already used. Of course you could append -1, -2, -3 etc to the end and the app would try until it gets a 404. And tinyurl only allows 30 chars custom but the odds shouldn't be that great that the System.getDeviceSettings().uniqueIdentifier would be exactly the same on two devices for the first 30 chars, one would think...