You are now set to Initialize Kruzr's SDK and its Trip Monitoring Object. Please note that initialization should be done in the Application Class of your project. All your interactions with the Kruzr SDK will happen through an instance of class Kruzr.
Initializing Kruzr SDK
To initialise the Kruzr SDK, you will need to call Kruzr’s init method within Application Class with the following parameters:
In order to start monitoring trips, you need to create an object for initiateTripMonitoring
Before we get to example of initiating TripMonitoring service, there are some important permission related factors to keep in mind on your app front to ensure TripMonitoring works properly (i.e. it is able to detect trips automatically):
On API Levels 23 and above: Make sure you ask user forManifest.permission.ACCESS_FINE_LOCATION
On API Levels 29 and above: Make sure you ask user for Manifest.permission.ACTIVITY_RECOGNITION
Once permission is given, call the below function to enable Automatic Trip Detection:
Once you have created instance of Kruzr SDK and set-up trip monitoring, you are now ready to register your user with Kruzr SDK and our back-end. Please continue to next section to set-up your first user!
Enabling/Disabling Auto trip start
You can check the current status of auto trip start through this method
Enabling/Disabling Auto trip end
You can check the current status of auto trip end through this method