Skip to content

Add/edit Key/Value setting to Android AppConfig

This function is used to add a new Key/Value setting to an existing Android AppConfig payload in the specified Device Application. If a setting with the specified key and type already exists, its value will be overwritten with the new value instead of creating a new setting. The key isn’t case-sensitive.

The Device Application must already contain an Android AppConfig payload with a configuration.

Public Function AddKeyValueToAppConfigAndroid(DeviceApplicationId As Integer, Key As String, Value As String, KeyValueType As String, changelogComment As String) As Boolean
Parameter Type Description
DeviceApplicationId Integer The Id of the Device Application. Get it with Get Device Applications.
Key String The key of the setting.
Value String The value of the setting. For the type Bool, use True or False.
KeyValueType String The type of the setting: String, Bool, Integer or Hidden. The value is case-sensitive.
changelogComment String A comment that is added to the changelog entry of the Device Application.

Returns a boolean value. True if succeeded, false if not. The function returns false if:

  • No Device Application with the specified Id is found.
  • The Device Application has no Android AppConfig payload, or the payload has no configuration.
  • The KeyValueType isn’t valid.
Set oCMS = CreateObject("CapaInstaller.SDK")
Wscript.echo oCMS.SetInstanceManagementPoint("2")
Dim iDeviceApplicationId : iDeviceApplicationId = 153
Dim sKey : sKey = "AllowSync"
Dim sValue : sValue = "True"
Dim sKeyValueType : sKeyValueType = "Bool"
Dim sChangelogComment : sChangelogComment = "Added setting AllowSync with sdk"
Wscript.echo "Added Android Setting AllowSync: " & oCMS.AddKeyValueToAppConfigAndroid(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)
sKey = "UserEmail"
sValue = ""
sKeyValueType = "String"
sChangelogComment = "Added setting UserEmail with sdk"
Wscript.echo "Added Android Setting UserEmail: " & oCMS.AddKeyValueToAppConfigAndroid(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)
sKey = "Port"
sValue = "80"
sKeyValueType = "Integer"
sChangelogComment = "Added setting Port with sdk"
Wscript.echo "Added Android Setting Port: " & oCMS.AddKeyValueToAppConfigAndroid(iDeviceApplicationId, sKey, sValue, sKeyValueType, sChangelogComment)