|
|
|
|
|
|
|
|
|
|
public void SetXmlValue() |
|
|
|
{ |
|
|
|
// get instatance of AGConnectConfig
|
|
|
|
// get config resId of xml file
|
|
|
|
// Sets a default value for a parameter.
|
|
|
|
config.applyDefault(configId); |
|
|
|
showAllValues(); |
|
|
|
} |
|
|
|
|
|
|
map.put("test3", 222); |
|
|
|
map.put("test4", 666.456); |
|
|
|
map.put("test5", "fromMap"); |
|
|
|
|
|
|
|
// Sets a default value for a parameter.
|
|
|
|
|
|
|
|
// fetch cloud setting, add success listener and failure listener
|
|
|
|
// Applies parameter values
|
|
|
|
// Checks whether the ConfigValues object contains a requested key.
|
|
|
|
// Returns the value of type for a key.
|
|
|
|
TestTip.Inst.ShowText($"configValues as string {configValues.getValueAsString("CloudString")}"); |
|
|
|
TestTip.Inst.ShowText($"configValues as byte first byte {configValues.getValueAsByteArray("CloudByte")[0]}"); |
|
|
|
TestTip.Inst.ShowText($"configValues as long {configValues.getValueAsLong("CloudLong").longValue()}"); |
|
|
|
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
// apply the config value laste fetched
|
|
|
|
public void GetCloudSettingsWorkNextTime() |
|
|
|
{ |
|
|
|
config = AGConnectConfig.getInstance(); |
|
|
|
|
|
|
showAllValues(); |
|
|
|
} |
|
|
|
|
|
|
|
// Fetches latest parameter values from the cloud at a custom interval.
|
|
|
|
// If the method is called within an interval, cached data is returned.
|
|
|
|
public void GetCloudSettingsFiveMins() |
|
|
|
{ |
|
|
|
config = AGConnectConfig.getInstance(); |
|
|
|
|
|
|
showAllValues(); |
|
|
|
} |
|
|
|
|
|
|
|
// Enables the developer mode,
|
|
|
|
// in which the number of times that the app fetches data from Remote
|
|
|
|
// Configuration is not limited, and traffic control is still performed over the cloud.
|
|
|
|
public void SetDeveloperMode() |
|
|
|
{ |
|
|
|
config = AGConnectConfig.getInstance(); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Clears all cached data,
|
|
|
|
// including the data fetched from Remote Configuration and the default values passed.
|
|
|
|
public void ClearCache() |
|
|
|
{ |
|
|
|
config = AGConnectConfig.getInstance(); |
|
|
|
|
|
|
|
|
|
|
// get all configs, print key and value pair
|
|
|
|
private void showAllValues() |
|
|
|
{ |
|
|
|
config = AGConnectConfig.getInstance(); |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// get all configs, print key and the source of a key.
|
|
|
|
private void GetAllValueWithSource() |
|
|
|
{ |
|
|
|
config = AGConnectConfig.getInstance(); |
|
|
|