Skip to main content
The Baato Navigation SDK adds a complete turn-by-turn navigation experience to an Android app — the map, the instruction banner, voice guidance and re-routing — on top of a route fetched from the Directions API.

Source on GitHub

baato/navigation-sdk

Worked example

A complete navigation screen, end to end.

Features

Turn-by-turn navigation

Voice instructions

Automatic re-routing

Custom map styles

Installation

1

Add the JitPack repository

In your project’s build.gradle:
2

Add the dependencies

Replace ${latest-version} with the current release tag from the releases page.
3

Configure the app module

If you use Mapbox as your map service, the SDK currently supports only these versions:
4

Declare the permissions

READ_PHONE_STATE is required only when your targetSdkVersion is 30 or above.

Managing location permission and updates

Navigation needs a live location fix, which means requesting the runtime permission and driving a location engine.
1

Implement PermissionsListener

2

Check the location permission

3

Initialise the location service

If you use multiple map instances, add the following code only to the base map activity. Once the location is calibrated, LocationEngineListener receives updates.
4

Listen for location updates

5

Deactivate the engine on destroy

Requesting a route

Fetch a route with BaatoNavigationRoute, following the Java client for the request itself. Once you have a route, the Navigation UI SDK takes over.

Launching turn-by-turn navigation

Launching navigation requires READ_PHONE_STATE when your targetSdkVersion is 30 or above. Declare it in the manifest and request it at runtime.
Once the permission is granted, launch the navigation UI from your activity with the route you fetched:
Setting shouldSimulateRoute(true) replays the route at your desk — the quickest way to test navigation without walking it. For a fuller mocking setup, see testing without moving.

Next

Complete turn-by-turn example

A full navigation screen: tap a destination, draw the route, hand off to the navigation UI.