Package com.bosch.wdw
Class WDWBuilder
- java.lang.Object
-
- com.bosch.wdw.WDWBuilder
-
public class WDWBuilder extends java.lang.ObjectThe
WDWBuilderis 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:
To receive push notification, it is necessary to create aWDWClient 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();PushConfigand call:
Generating a.setPushConfiguration(PushConfig pushconfig)PushConfigis shown below:
By design, thePushConfig pushConfig = new PushConfig(pushServerURL, senderID, variantID, variantSecret);LogLevelof the WDW-SDK is set toLogLevel.Warning. This can be changed by calling:
There are four different log level options described in:.setLogLevel(logLevel)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:
There are three predefined list available to set or create an subset of:.setSupportedCountries(String[] supportedCountries)
ALLrepresenting all supported countries.
NORTH_AMERICArepresenting all supported countries in north america.
USArepresenting USA as list.
EUROPErepresenting all supported countries in europe.
GERMANYrepresenting Germany as list.
Country codes in the array need to be defined by the ISO3166 ALPHA 2 standard.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]ALLstatic java.lang.String[]EUROPEstatic java.lang.String[]GERMANYstatic java.lang.String[]NORTH_AMERICAstatic java.lang.String[]USA
-
Constructor Summary
Constructors Constructor Description WDWBuilder(android.content.Context context, WDWClientCallback wdwClientCallback, java.lang.String fleetID)Constructor for the WDWBuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WDWClientbuild()Creates an instance of the WDW-SDK and returns aWDWClientWDWBuildersetLogLevel(LogLevel logLevel)Sets theLogLevelto adjust the log output of the WDW-SDK.WDWBuildersetPushConfiguration(PushConfig pushConfig)Sets thePushConfigto enable receiving push notifications by the WDW-SDKWDWBuildersetSupportedCountries(java.lang.String[] supportedCountries)Sets the supported countries in which the WDW-SDK generates data.
-
-
-
Constructor Detail
-
WDWBuilder
public WDWBuilder(android.content.Context context, WDWClientCallback wdwClientCallback, java.lang.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 Detail
-
build
public WDWClient build()
Creates an instance of the WDW-SDK and returns aWDWClient- Returns:
WDWClient
-
setPushConfiguration
public WDWBuilder setPushConfiguration(PushConfig pushConfig)
Sets thePushConfigto enable receiving push notifications by the WDW-SDK- Parameters:
pushConfig- object needed to register atGoogle Cloud Messaging Service.- Returns:
- this.
-
setLogLevel
public WDWBuilder setLogLevel(LogLevel logLevel)
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
public WDWBuilder setSupportedCountries(java.lang.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 .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.
-
-