setup
Setup the Fairmatic SDK with a configuration and a intent service for SDK callbacks. This will start tracking the phone's movements to track any driving activity. The application should call this method before anything else in the Fairmatic SDK.
This API should should be called in onCreate() method of application class. If you don't have an application class, you should create one and specify it in your AndroidManifest.xml file.
Calling this method multiple times with the same 'sdkKey' and 'driverId' in the com.fairmatic.sdk.classes.FairmaticConfiguration is a no-op. If provided, the com.fairmatic.sdk.classes.FairmaticBroadcastReceiver class will be sent SDK callbacks after the call. If either the 'sdkKey' or 'driverId' in the com.fairmatic.sdk.classes.FairmaticConfiguration changes between the previous setup call and this one, it will be the same as calling com.fairmatic.sdk.Fairmatic.teardown followed by calling setup with the new parameters.
Once setup finishes, the com.fairmatic.sdk.classes.FairmaticOperationCallback is called (if provided) with the result of the setup operation. Callback will be made on calling thread if it's Looper is already prepared, else the callback is made on the Main Thread.
Parameters
is the context object of the enclosing application.
The configuration properties to setup the Fairmatic SDK. Cannot be null.
A intent service which receives callbacks from the SDK. It receives updates about interesting events like start and end of a drive, accident detected etc from the SDK. Specify null if you don't want to receive callbacks from the SDK.
A FairmaticNotificationProvider class that is used to fetch notifications when the sdk goes foreground.
The callback to be invoked after setup. It will be invoked on the same thread where setup is called. This can be null if no callback is desired by the application.