Android SDK Methods (Android) Trip v2 SDK Methods (Android) Get Trip (Android) Explore how to get the details of a trip on Android with Trips v2.
To get the details of the trip anytime, you can use the Roam.getTrip("tripId") method by passing the tripID.
Java Kotlin
Copy RoamTrackingMode roamTrackingMode = new RoamTrackingMode . Builder (distanceFilter , stopDuration)
. setDesiredAccuracy ( RoamTrackingMode . DesiredAccuracy . HIGH )
. build ();
Roam . getTrip ( "tripId" , new RoamTripCallback() {
@ Override
public void onSuccess ( RoamTripResponse response) {
//get trip details
}
@ Override
public void onError ( Error error) {
//get error details
}
});
Copy Roam. getTrip ( "tripId" , object : RoamTripCallback {
override fun onSuccess (response: RoamTripResponse ) {
//get trip details
}
override fun onError (error: Error ?) {
//get error details
}
})
The trip response and its parameters are similar to those of the createTrip method.
There's no need to exclusively specify if the trip is local or not using a boolean value. The getTrip()
method will check that for you and update the trip details accordingly.