Package com.bosch.wdw

Class WDWBuilder

java.lang.Object
com.bosch.wdw.WDWBuilder

public class WDWBuilder extends Object

The WDWBuilder is used to create an instance of the WDW-SDK.

It returns an instance of the WDWClient interface. The following example shows how to build the basic WDWClient. This does not contain push notifications or evaluation of incoming messages:

 
   WDWClient wdwClient  = new WDWBuilder(getApplicationContext(), new WDWClientCallback(){ 
@Override public void on AreaEntered(String tripId){}
@Override public void on AreaLeft(String tripId){}
@Override public void onDataCollected(String data){}
@Override public void onErrorOccured(Error error(){}
@Override public void onWarningReceived(WarningEvent warningEvent){}
}, "YourFleetID").build();
To receive push notification, it is necessary to create a PushConfig and call:
   
     .setPushConfiguration(PushConfig pushconfig)
   
 
Generating a PushConfig is shown below:
 
  PushConfig pushConfig = new PushConfig(pushServerURL, senderID, variantID, variantSecret);
 
 
By design, the LogLevel of the WDW-SDK is set to LogLevel.Warning. This can be changed by calling:
  
   .setLogLevel(logLevel)
 
 
There are four different log level options described in: LogLevel
If the logLevel is null, the default log level will be set.

The WDW-SDK generates data in each country supported. To limit this, a list of all supported countries can be set by calling:
  
   .setSupportedCountries(String[] supportedCountries)
 
 
There are three predefined list available to set or create an subset of:
ALL representing all supported countries.
NORTH_AMERICA representing all supported countries in north america.
USA representing USA as list.
EUROPE representing all supported countries in europe.
GERMANY representing Germany as list.
Country codes in the array need to be defined by the ISO3166 ALPHA 2 standard.
  • Field Details

    • ALL

      public static final String[] ALL
    • NORTH_AMERICA

      public static final String[] NORTH_AMERICA
    • USA

      public static final String[] USA
    • EUROPE

      public static final String[] EUROPE
    • GERMANY

      public static final String[] GERMANY
  • Constructor Details

    • WDWBuilder

      public WDWBuilder(android.content.Context context, WDWClientCallback wdwClientCallback, String fleetID)
      Constructor for the WDWBuilder
      Parameters:
      context - the applicationContext of the integrating application.
      wdwClientCallback - implemented WDWClientCallback of the integrating application.
      fleetID - represents the unique identifier of your fleet and is provided by Bosch.
  • Method Details

    • build

      public WDWClient build()
      Creates an instance of the WDW-SDK and returns a WDWClient
      Returns:
      WDWClient
    • setPushConfiguration

      public WDWBuilder setPushConfiguration(PushConfig pushConfig)
      Sets the PushConfig to enable receiving push notifications by the WDW-SDK
      Parameters:
      pushConfig - object needed to register at Google Cloud Messaging Service.
      Returns:
      this.
    • setLogLevel

      public WDWBuilder setLogLevel(LogLevel logLevel)
      Sets the LogLevel to adjust the log output of the WDW-SDK.
      Parameters:
      logLevel - is definable if more log information is needed. See LogLevel for detailed information.
      Returns:
      this.
    • setSupportedCountries

      public WDWBuilder setSupportedCountries(String[] supportedCountries)
      Sets the supported countries in which the WDW-SDK generates data. If this method is not called, data will be generated in each country supported by the WDW-SDK . ALL is representing an array of all supported countries. It is possible to define a subset of these countries to choose in which country the WDW-SDK generates data. The predefined Lists are: All ALL Europe EUROPE GERMANY GERMANY If a custom list is created, the ISO3166 ALPHA 2 standard needs to be used.
      Parameters:
      supportedCountries - are definable as an array to list all countries in which the WDW-SDK generates data.
      Returns:
      this.