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.

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
                    }
                });

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.

Last updated