THIS SDK ISDEPRECATED. We rolled out a new and better SDK for you.
Allow your users to plan a route that will be the fastest, shortest, most thrilling, or environment
friendly.
Sample use case: You plan a trip from Amsterdam to Rotterdam and want to compare ETAs for
different types of routes to choose the best fit your preferences.
Available route types:
Copy 1 routeType = RouteType . FASTEST
2 routeType = RouteType . SHORTEST
3 routeType = RouteType . ECO
4 routeType = RouteType . THRILLING
To request a route for a specified travel type:
Copy 1 RouteDescriptor routeDescriptor = new RouteDescriptor . Builder ( )
3 . considerTraffic ( false )
6 RouteCalculationDescriptor routeCalculationDescriptor = new RouteCalculationDescriptor . Builder ( )
7 . routeDescription ( routeDescriptor )
9 . reportType ( ReportType . EFFECTIVE_SETTINGS )
10 . instructionType ( InstructionsType . TEXT )
13 RouteSpecification routeSpecification = new RouteSpecification . Builder (
14 routeConfig . getOrigin ( ) ,
15 routeConfig . getDestination ( )
17 . routeCalculationDescriptor ( routeCalculationDescriptor )
Copy 1 val routeDescriptor = RouteDescriptor . Builder ( )
3 . considerTraffic ( false )
6 val routeCalculationDescriptor = RouteCalculationDescriptor . Builder ( )
7 . routeDescription ( routeDescriptor )
8 . reportType ( ReportType . EFFECTIVE_SETTINGS )
9 . instructionType ( InstructionsType . TEXT )
12 val routeSpecification = RouteSpecification . Builder ( origin , destination )
13 . routeCalculationDescriptor ( routeCalculationDescriptor )
Route type eco
Route type fastest
Route type shortest