Creating Implementations for SDK Callbacks

You are now ready to start implementing methods within SDK Callbacks!

This section walks you through Trip State and Notifications call backs and available methods within both. While implementing, it is important that you understand the purpose and function of each of these methods. We would request that please go through our section on Understanding Features & Methods of Kruzr SDK section if you have not already.

Trip State Callback Implementations

In order to use the various trip states we offer, you will need to create an implementation of TripCallbackInterface where you will receive callbacks as shown below.

public class MyTripCallbacks implements TripCallbackInterface {

   @Override
   public void onTripDetectionStarting(TripData tripData) {
   }

   @Override
   public void onTripStarted(TripData tripData) {
   }

   @Override
   public void onTripPaused(TripData tripData) {
   }

   @Override
   public void onTripResumed(TripData tripData) {
   }

   @Override
   public void onTripEnded(TripData tripData) {
   }
}

Notification Callbacks Implementations

In order to take action on notifications states we offer, you will need to create an implementation of NotificationClickCallbackInterface where you will receive callbacks as shown below.

public class MyNotificationCallbacks implements NotificationClickCallbackInterface {

   @Override
   public void onDriveOngoingNotificationClick() {
   }

   @Override
   public void onDriveDeterminingNotificationClick() {
   }

   @Override
   public void onDriveSummaryNotificationClick() {
   }
}

In the next section, we will look at ways to register for necessary Callbacks to implement these into your app.

Last updated

Was this helpful?