This folder defines device-specific configuration via code-based constants, replacing Garmin SDK Properties, which have significant limitations.
The Garmin SDK’s Properties are stored externally from the app and persist across installations. This means that when a new version of the app is installed, any existing properties from the previous version remain, unless the user performs a full uninstall and reinstall. To avoid this issue and allow reliable updates, the app uses Constants instead:
- Constants are part of the code base and automatically update with new app versions.
- The compiler validates constant usage, reducing runtime errors.
- Constants can be cleanly overridden for specific devices.
All devices inherit default values from BaseConfig and GlanceBaseConfig, which define all configuration values used in the Widget and Glance, respectively.
In the source code, these are accessed via the Config and GlanceConfig classes. Each supported device may override the defaults by providing its own implementation of these classes.
Additional base classes can be introduced for specific device families. For example, EdgeBaseConfig inherits from BaseConfig and overrides values that apply to all Edge devices. Concrete Config implementations for individual Edge models can then further override selected values defined in the Edge base configuration.
base/: ContainsBaseConfigandGlanceBaseConfig, which define the baseline values for all devices.device-default/: Contains defaultConfigandGlanceConfigimplementations. These inherit all values from the base without overrides.device-<device-name>/: Contains device-specific implementations ofConfigandGlanceConfig, overriding select values to adapt the UI for the particular device.