DriveMotionClient
DriveMotion supports starting and stopping driving through method calls instead of automatic detection in manual mode. To use this feature, developers must obtain TNDriveMotionClient after initializing DriveMotion.
Get TNDriveMotionClient
Use TNDriveMotionClient
TNDriveMotionClient provides the entrance to start driving and stop driving manually, but TNDriveDetectionMode must be set to manual, otherwise TNDriveMotionException will be generated.
Start Drive
The startDrive()
method will notify DriveMotion to create a new trip and start it. This is an asynchronous operation. When DriveMotion completes all this, it will send TNDriveStartEvent to the application via broadcast. Then the application can get the session id, trip id, start time and start location information with the SDK.
Start Drive in synchronous [Deprecated, using asynchronous instead]
Start Drive in asynchronous
Stop Drive
The stopDrive()
method will notify DriveMotion to end current trip. This is an asynchronous operation. When DriveMotion completes end, it will send TNDriveEndEvent and TNDriveAnalyzedEvent to the application via broadcast. Then the application can get the session id, trip id, end time, end location and trip valid status information with the SDK by DriveEndEvent. And driveAnalyzedEvent will contain the final trip information and score information.
Note
If the trip distance is too short or been detected as invalid trip, it will be hidden from any API calls when trip finished. The value driveEndEvent.isValidTrip
will indicate the specific status of the finished trip.
Stop Drive in synchronous [Deprecated, using asynchronous instead]
Stop Drive in asynchronous