Package com.bosch.wdw
Class WDWBuilder
java.lang.Object
com.bosch.wdw.WDWBuilder
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWDWBuilder(android.content.Context context, WDWClientCallback wdwClientCallback, String fleetID) Constructor for the WDWBuilder -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an instance of the WDW-SDK and returns aWDWClientsetLogLevel(LogLevel logLevel) Sets theLogLevelto adjust the log output of the WDW-SDK.setPushConfiguration(PushConfig pushConfig) Sets thePushConfigto enable receiving push notifications by the WDW-SDKsetSupportedCountries(String[] supportedCountries) Sets the supported countries in which the WDW-SDK generates data.
-
Field Details
-
ALL
-
NORTH_AMERICA
-
USA
-
EUROPE
-
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- implementedWDWClientCallbackof the integrating application.fleetID- represents the unique identifier of your fleet and is provided by Bosch.
-
-
Method Details
-
build
Creates an instance of the WDW-SDK and returns aWDWClient- Returns:
WDWClient
-
setPushConfiguration
Sets thePushConfigto enable receiving push notifications by the WDW-SDK- Parameters:
pushConfig- object needed to register atGoogle Cloud Messaging Service.- Returns:
- this.
-
setLogLevel
Sets theLogLevelto adjust the log output of the WDW-SDK.- Parameters:
logLevel- is definable if more log information is needed. SeeLogLevelfor detailed information.- Returns:
- this.
-
setSupportedCountries
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 .ALLis 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: AllALLEuropeEUROPEGERMANYGERMANYIf 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.
-