public class WDWBuilder
extends java.lang.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
.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. | Modifier and Type | Field and Description |
|---|---|
static java.lang.String[] |
ALL |
static java.lang.String[] |
EUROPE |
static java.lang.String[] |
GERMANY |
static java.lang.String[] |
NORTH_AMERICA |
static java.lang.String[] |
USA |
| Constructor and Description |
|---|
WDWBuilder(android.content.Context context,
WDWClientCallback wdwClientCallback,
java.lang.String fleetID)
Constructor for the WDWBuilder
|
| Modifier and Type | Method and Description |
|---|---|
WDWClient |
build()
Creates an instance of the WDW-SDK and returns a
WDWClient |
WDWBuilder |
setLogLevel(LogLevel logLevel)
Sets the
LogLevel to adjust the log output of the WDW-SDK. |
WDWBuilder |
setPushConfiguration(PushConfig pushConfig)
Sets the
PushConfig to enable receiving push notifications by the WDW-SDK |
WDWBuilder |
setSupportedCountries(java.lang.String[] supportedCountries)
Sets the supported countries in which the WDW-SDK generates data.
|
public static final java.lang.String[] ALL
public static final java.lang.String[] NORTH_AMERICA
public static final java.lang.String[] USA
public static final java.lang.String[] EUROPE
public static final java.lang.String[] GERMANY
public WDWBuilder(android.content.Context context,
WDWClientCallback wdwClientCallback,
java.lang.String fleetID)
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.public WDWClient build()
WDWClientWDWClientpublic WDWBuilder setPushConfiguration(PushConfig pushConfig)
PushConfig to enable receiving push notifications by the WDW-SDKpushConfig - object needed to register at Google Cloud Messaging Service.public WDWBuilder setLogLevel(LogLevel logLevel)
LogLevel to adjust the log output of the WDW-SDK.logLevel - is definable if more log information is needed.
See LogLevel for detailed information.public WDWBuilder setSupportedCountries(java.lang.String[] supportedCountries)
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.supportedCountries - are definable as an array to list all countries in which the WDW-SDK
generates data.