- Print
- DarkLight
- PDF
Setting and changing configuration settings can be done both manually and programmatically. See the WTConfigKeys
class documentation for more specific details on each setting.
Configuration Settings for running the Webtrends Mobile Library for Android
If you implement the library using the recommended settings, you should not need to make any modifications beyond specifying the DCSID. However, you can use the documented configuration settings to customize the operations of the Webtrends Mobile Library. Configuration information for the library is stored as strings starting with wt_dc_ in
the webtrends.xml
file and settable programatically using the setConfigSetting()
method. All settings are stored as strings and all keys are defined as constants in the WTConfigKeys
class.
There are two ways to set config settings:
- Using the
webtrends.xml
file - Programmatically using the
WTDataCollector.setConfigSetting
method.
Setting Configuration Using the webtrends.xml File
Setting configuration settings can be done at design time by using the webtrends.xml
file. In addition to the required settings in this file (such as DCSID, Optimize project locations, Account GUID, etc), you may add entries for any of the config settings. Simply edit the XML file and set the key to the chosen config key and the value to an appropriate value.
For example, to configure the SDK to only send events when the device is connected to wifi, add this entry to the XML file:
...
<string name="wt_dc_only_send_over_wifi">true</string>
...
Setting Configuration Programmatically
To set config settings programmatically within your app, you can use the setConfigSetting()
method in the WTDataCollector
class. The method takes a key, a value, and a boolean that tells the method to persist the setting or not.
Here is an example of setting the battery threshold config value:
// Set the minimum battery charge percent to 15% and persist the change
WTDataCollector.getInstance().setConfigSetting(WTConfigKeys.BATTERY_MIN_CHG_PERCENT, "15", true);
Alternatively, you may use the string key directly without referencing the string constant:
// Set the minimum battery charge percent to 15% and DO NOT persist the change
WTDataCollector.getInstance().setConfigSetting("wt_dc_battery_min_charge_percent", "15", false);
Using Webtrends Remote Configuration Service (RCS)
Webtrends also offers the ability to set configuration settings remotely. By setting up rules, you are able to push specific config settings out to certain segments of your installed user base. For example, you could create an RCS rule that sets all devices connected to AT&T in the US to send data every 10 minutes, while all others send data every hour.
This feature is only available through our support organization. Please contact your account representative for details.
The Remote Configuration Service (RCS) allows you to push new configuration settings for the Webtrends SDK without having to deploy a new build. This means that you can change the way your SDK behaves on remote devices as the market changes or your collection needs change.
RCS achieves this by periodically polling a Webtrends rules server to see if there are any rules available for your account, and then checking to see if any of those rules apply to the app doing the polling. This means that RCS is most successful in apps running on devices with high internet connectivity.
If you suspect that you might want to use RCS rules during the lifetime of your application, it is recommended that you enable RCS polling when you first deploy your app to the marketplace, even if you aren’t currently using any rules. You can always shut it off, but once an app is in the field, you can’t retroactively turn it on.
To enable RCS, set wt_dc_rcs_enabled
setting to ‘true’
in your SDK configuration file.
There are several ways in which you might use RCS during the lifecycle of an app. For example, if you wanted to turn off data collection for applications or application versions using a particular DCSID, you can work with Webtrends to set a rule that disables data collection for those DCSID or DCSID combinations.
Another possible use is changing the send rates for your applications. Perhaps you had a default send rate of 30 minutes, but find the average usage time of your users was closer to 17 minutes. You can change the send rate to 15 minutes to try and get more data sent before the user shuts off the app.
As a final example, you could create a rule that sets the “Only Send Over WiFi“ flag to true for all AT&T Wireless customers in Canada. Any set of device/application parameters can be combined into a pseudo WHERE clause that can be used to apply a set of one or more configuration settings.
At this time, setting and changing RCS rules must be assisted by Webtrends Technical support. Contact your account representative or call support directly to collect the necessary details to update or create new RCS rules for your account.
List of Configuration Settings
For a complete list of all configuration settings available in the Webtrends Mobile SDK, see the WTConfigKeys
class documentation.