Bike Demo
This example is a complete bike navigation app. It shows the map at the current position, lets the user find a destination by free-text search, category, or by tapping the map, computes a route using a bicycle routing profile, and then runs turn-by-turn navigation or simulation along it. The bike profile is configurable: the user can switch between city, cross, mountain, and road bikes, toggle an electric bike and tune its parameters (hills factor, bike and biker weight, auxiliary consumption), and choose to avoid ferries or unpaved roads.
Setting up the bike routing profile
Routing for a bicycle is driven entirely by the RoutePreferences. The view model builds them once the map is ready: the transport mode is set to ERouteTransportMode.Bicycle and an initial EBikeProfile is applied with setBikeProfile. When the electric-bike toggle is on, an ElectricBikeProfile is passed in so the route accounts for battery consumption; otherwise null is used.
Configuring the position source for cycling
As soon as the default map view is created, the position data source is configured for cycling. Setting ImprovedPositionDefTransportMode to "bike" makes the position arrow snap to bike-accessible roads even outside navigation, while enabling ImprovedPosPreferRouteSnap keeps it locked to the active route while navigating.
Calculating the bike route
When the user confirms a destination, the route is computed from the current position with the RoutingService. The bike RoutePreferences built by the view model are assigned to the service right before calculateRoute, so every calculation reflects the currently selected bike profile and settings. calculateRoute only reports whether the calculation could be started: if it returns an error the request never began - so the progress UI is cleared and the failure is shown right away - whereas a successful start is followed later by the service's onCompleted callback.
Starting navigation or simulation
Once a route is ready it is presented on the map and the user can either Start real turn-by-turn navigation or run a Demo (simulation) along it. Both use the same NavigationService and NavigationListener; the only difference is startNavigationWithRoute versus startSimulationWithRoute.
Tuning the bike profile
The settings screen exposes the parameters that shape the route. The E-Bike switch turns the electric profile on or off, the Hills slider sets avoidBikingHillFactor, and additional switches and sliders let the user avoid ferries or unpaved roads and tune the electric profile's bike mass, biker mass, and auxiliary consumption. Each control writes straight back into the shared RoutePreferences / ElectricBikeProfile, so the next calculated route picks the changes up immediately.





