Interface TelematicsCallback


public interface TelematicsCallback
A callback interface to handle success and error events for Telematics SDK operations. Implement this interface to receive notifications when an operation completes successfully or fails.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when the operation fails with an error.
    void
    Called when the operation is successful.
  • Method Details

    • onSuccess

      void onSuccess()
      Called when the operation is successful. Implementations can use this method to handle any post-success logic.

      Example usage:

       
       telematicsSDK.login("userId", "group", "serviceId", new TelematicsCallback() {
           @Override
           public void onSuccess() {
               // Handle success, such as updating UI or logging
           }
      
           @Override
           public void onError(TelematicsSDKException e) {
               // Handle error
           }
       });
       
       
    • onError

      void onError(TelematicsSDKException e)
      Called when the operation fails with an error. Implementations can use this method to handle error scenarios.
      Parameters:
      e - the exception that occurred during the operation, providing details about the failure

      Example usage:

       
       telematicsSDK.login("userId", "group", "serviceId", new TelematicsCallback() {
           @Override
           public void onSuccess() {
               // Handle success
           }
      
           @Override
           public void onError(TelematicsSDKException e) {
               // Handle error, such as displaying a message to the user
               L.d("TelematicsSDK", "Error during login", e);
           }
       });