Skip to content

DriveMotionAlertReceiver

DriveMotionAlertReceiver is an abstract class for users to receive safety alerts through broadcast.

Implement Application's Receiver For DriveMotion Alert Broadcast

For how to configure the implementation class of DriveMotionAlertReceiver, please refer to Initialize the SDK. And no matter whether DriveDetectionMode is AUTO or MANUAL, the application can learn the dynamics of the trip alerts through this broadcast.

Note

Broadcasts sent by the SDK can be received only after the receiver is correctly configured when initialize.

1
2
3
4
5
6
7
    public class AppDriveMotionAlertReceiver extends DriveMotionAlertReceiver {

        @Override
        public void onSpeedingAlert(SpeedingAlertEvent speedingAlertEvent) {
            // Do something
        }
    }
1
2
3
4
5
    class AppDriveMotionAlertReceiver : DriveMotionAlertReceiver() {
        override fun onSpeedingAlert(speedingAlertEvent: SpeedingAlertEvent) {
            // Do something
        }
    }

Alert Event

  • SpeedingAlertEvent: When user start speeding in a short time, DriveMotion will broadcast this alert event, which mainly includes tripId, speeding start time and start location, and current alert level.