com.webtrends.mobile.analytics.rim
Class WebtrendsConfigurator

java.lang.Object
  extended by com.webtrends.mobile.analytics.rim.WebtrendsConfigurator

public final class WebtrendsConfigurator
extends java.lang.Object

Specifies configuration settings that an application uses for sending data to the data collection server. To customize the settings, you can change the values in the configuration file that is included with the BlackBerry Analytics Service SDK. To load the configuration settings in an application, you must invoke LoadConfigFile().


Constructor Summary
WebtrendsConfigurator()
           
 
Method Summary
static void LoadConfigFile(IWebtrendsConfig config)
          Loads the settings from IWebtrendsConfig interface.
static void LoadConfigFile(java.lang.String packageName, java.lang.String filename)
          Loads the settings from the configuration file into the application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebtrendsConfigurator

public WebtrendsConfigurator()
Method Detail

LoadConfigFile

public static void LoadConfigFile(java.lang.String packageName,
                                  java.lang.String filename)
Loads the settings from the configuration file into the application. In an Eclipse project, you must place the config file in the same package as a .java source file for your application (for example, 'com/webtrends/sample/helloworld/webtrends.xml'). In a JDE project, you must place the config file at the root of the project. The following code sample demonstrates how to load a configuration file into an application in Eclipse, where the webtrends.xml is located in the the com.samples package along with AnalyticsDemo.java.
 WebtrendsConfigurator.LoadConfigFile("com.samples.AnalyticsDemo", "webtrends.xml"); 
 
For more information, see the BlackBerry Analytics Service SDK Development Guide at www.blackberry.com/go/analyticsdocs.

Parameters:
packageName - The fully qualified name of a .java source file that is in the same location as the config file (for example, com.webtrends.sample.HelloWorldApp).
filename - The name of the XML file that is being loaded.

LoadConfigFile

public static void LoadConfigFile(IWebtrendsConfig config)
Loads the settings from IWebtrendsConfig interface. This method allows you pass settings in directly by passing a class as a parameter. The class is an implementation of the IWebtrendsConfig interface. This is an alternative method of loading configuration settings into the application. No configuration file is required using this technique.

The following code sample demonstrates using the IWebtrendsConfig interface.

 WebtrendsConfigurator.LoadConfigFile(
     new IWebtrendsConfig()
     {
         // Category of your application.
         public String wt_dc_app_category() {
             return "YOUR_APPLICATION_CATEGORY_HERE";
         }
         // Name of your application.
         public String wt_dc_app_name() {
             return "YOUR_APPLICATION_NAME_HERE";
         }
         // Publisher of your application (vendor or developer name).
         public String wt_dc_app_publisher() {
             return "YOUR_PUBLISHER_NAME_HERE";
         }
         // Version of your application.
         public String wt_dc_app_version() {
             return "1.0";
         }
         // Percent of battery life remaining when event send is paused.
         public String wt_dc_charge_threshold_minimum() {
             return "30";
         }
         // Supply a unique ID in the format dcsxxxxxxxxxxxxxxxxxxxxxx_xxxx that is associated with a Webtrends data source.
         public String wt_dc_dcsid() {
             return "YOUR_WEBTRENDS_DCSID_HERE";
         }
         // Set this value to "true" if you want to enable application logging.
         public String wt_dc_debug() {
             return "false";
         }
         // Set this value to "false" if you want to disable the Webtrends library.
         public String wt_dc_enabled() {
             return "true";
         }
         // Number of times to retry sending an event in response to send error.
         public String wt_dc_event_retry_maximum() {
             return "5";
         }
         // Maximum number of events stored in event queue.
         public String wt_dc_event_table_size_maximum() {
             return "10000";
         }
         //  Set this value to "true" if you want the Webtrends library to request PERMISSION_INTERNET, PERMISSION_CROSS_APPLICATION_COMMUNICATION, PERMISSION_SECURITY_DATA from the permission database.
         public String wt_dc_request_permission() {
             return "false";
         }       
         // Session expiration in minutes.
         public String wt_dc_session_maximum() {
             return "480";
         }
         // Session timeout in minutes.
         public String wt_dc_session_timeout() {
             return "30";
         }
         // Timezone of datasource in number of hours offset from GMT.
         public String wt_dc_timezone() {
             return "-8";
         }
         // Data Collection API base URL.
         public String wt_dc_url() {
             return "https://dc.webtrends.com/v1";
         }
     }
 );
 
For more information, see the BlackBerry Analytics Service SDK Development Guide at www.blackberry.com/go/analyticsdocs.

Parameters:
config - Class that implements IWebtrendsConfig interface.