Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
cfg.Initialize("Config")
cfg.Defaults(CreateMap("promo_code": "", "loading_phrase": "Hallo world!"))
Log("loading_phrase="&cfg.getString("loading_phrase"))
Log("promo_code="&cfg.getString("promo_code"))
Log("Fetching")
cfg.fetch(0)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Config_onFetchComplete(success As Boolean)
Log($"Config_onFetchComplete(${success})"$)
If success Then
Log("Activate fetched values")
cfg.activateFetched
Log("loading_phrase="&cfg.getString("loading_phrase"))
Dim info As RemoteConfigValue = cfg.getValue("loading_phrase")
Log($"Loading phrase info: Source ${info.Source}, ${info.asString}"$)
Dim info As RemoteConfigValue = cfg.getValue("promo_code")
Log($"Promocode info: Source ${info.Source}, ${info.asString}"$)
End If
End Sub