NAV Navbar
  • Changelog
  • Introduction
  • Prerequisites
  • Adding the SDK
  • Getting Started
  • Using ProximiioMapbox Helper
  • Custom Markers
  • Documentation
  • Changelog


    5.1.7, 5.1.8

    5.1.5, 5.1.6




    Outside navigation using OSRM

    Navigation can now route outside of defined places and paths, leveraging OSRM. Navigating outside requires active internet connection. With this change, areas called "Campus" were added (managed via portal Campuses define domains where local routing (Wayfinding) is to be used. Defining campuses is required for proper functionality. Note that if you did not set up any campus, the SDK will only use indoor Wayfinding.

    If using outside navigation, please contact us to check for supported areas (contries).

    IMPORTANT: With this version, the library repository was renamed from io.proximi.proximiiolibrary:mapbox to io.proximi.library:mapbox. You need to only update the package import in your gradle file.


    In addition to outside routing, navigation can now be requested to route via Waypoints. Two kinds of waypoints were introduced: - SimpleWaypoint: a waypoint the route has to route through unconditionally - VariableWaypoint: list of waypoints, from which the one with shortest route is selected.

    In conjunctions with other changes in this release, the methods to request navigation (route) were changed. SDK provides three methods: - routeFind - attempts to find a route according to parameters, returns route object in a callback, - routeFindAndPreview - additionally, the route is previewed on map, - routeFindAndStart - finds and returns route via callback, shows it on map, and initiates navigation immediatelly.

    All methods accept the same parameters, that is two objects: - RouteConfiguration - object describing all the requirements of the route. - RouteCallback - callback object (receives route and other navigation events).








    Welcome to the Android ProximiioMapbox helper API reference guide. You can use this library to easily hook up with a MapLibre map in your Android application. Note this library is standalone from the Location SDK. To learn how to set up the location library, go here.

    Features include:

    You can find the Android SDK reference here. You should understand the basics before using this library.

    Code samples can be found on the right side of the page.

    To create and manage your map data, we have created a brand new map editor available here.

    Prerequisites Android SDK


    This SDK requires the use of multidexing.

    Please set up your application to use multidex, as guided here.

    Adding the SDK

    repositories {
        maven {
            url ""

    Add the repository to either your module's or project's build.gradle.

    In your app module's build.gradle file, add a library dependency and set Java compatibility to 1.8. Due to an issue with JS engine library, please include the library in your top-level (app) module as shown in sample.

    android {
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
    dependencies {
        // Add SDK, exclude JS engine library (due to multidex issue when included by the library)
        implementation ('io.proximi.library:mapbox:5.1.9') { exclude group: 'com.eclipsesource.j2v8' }
        // Include JS engine manually
        implementation ('com.eclipsesource.j2v8:j2v8:6.1.0@aar')

    Replace the dependency version number with the latest published version available here: Download

    Getting Started

    Seting up libraries

    Dependency for Mapbox is included in this library. However, Mapbox map view must be set up in the application.

    1) Use map view in your activity layout

    <?xml version="1.0" encoding="utf-8"?>

    2) Initialize Mapbox and Proximiio libraries

    const val PROXIMIIO_AUTH_TOKEN = "[your authentication token]"
    class MainActivity : AppCompatActivity() {
        // Proximiio mapbox helper instance
        private lateinit var proximiioMapbox: ProximiioMapbox
        override fun onCreate(savedInstanceState: Bundle?) {
            // Init Mapbox
            Mapbox.getInstance(this, PROXIMIIO_AUTH_TOKEN)
            // Init ProximiioMapbox helper
            proximiioMapbox = ProximiioMapbox.getInstance(baseContext, PROXIMIIO_AUTH_TOKEN, NULL)
            // Mapbox Mapview onCreate callback; note mapview corresponds to the MapView we added to layout in the section above
            // Get map and pass it to ProximiioMapbox helper
            mapView.getMapAsync { mapboxMap ->
        override fun onStart() {
        override fun onResume() {
        override fun onPause() {
        override fun onStop() {
        override fun onDestroy() {
        override fun onLowMemory() {
        override fun onSaveInstanceState(outState: Bundle, outPersistentState: PersistableBundle) {
            super.onSaveInstanceState(outState, outPersistentState)
        fun onLogoutClicked() {

    At this point, running the application should display the map properly.

    Using ProximiioMapbox Helper

    Managing user's location on map

        val apiListener = object: ProximiioListener() {
             *  1) Update current user level (to keep current location updated for navigation)
             *  2) Update display level (will show / hide geojson based on its level)
            override fun changedFloor(floor: ProximiioFloor?) {
                proximiioMapbox.updateUserLevel(floor?.floorNumber ?: 0)
                proximiioMapbox.updateDisplayLevel(floor?.floorNumber ?: 0)
             *  Update user's current location to:
             *  1) to keep current location updated for navigation
             *  2) to move user's location marker on map
            override fun position(location: Location) {

    As mentioned above, Location SDK is a standalone library. To update user's location on map, location updates must be passed to the ProximiioMapbox helper.

    The updateUserLocation(location: Location): Location method processes the location internally and returns new (altered) Location object. The returned location object:

    Accessing data

    You can search for features using the search methods. The simpler search(String filterInput) method will return list of features with title containing the input string.
    Alternatively, you can use search(ProximiioSearchFilter filter, String ...filterInputs) to pass a custom ProximiioSearchFilter object and desired number of inputs to create custom search experiences. See below for the ProximiioSearchFilter class documentation.

    Raw data access

    You can also access raw data using the following methods:

    Note that these methods return the Android's LiveData object to enable observation of data updates.

    The ProximiioMapbox helper is capable of providing full guidance experience to the user. That is:

    Starting and managing navigation

    There are three methods available to initiate routing: - routeFind - attempts to find a route according to parameters, returns route object in a callback, - routeFindAndPreview - additionally, the route is previewed on map, - routeFindAndStart - finds and returns route via callback, shows it on map, and initiates navigation immediatelly.

    All methods accept the same parameters, that is two objects: - RouteConfiguration - object describing all the requirements of the route. - RouteCallback - callback object (receives route and other navigation events).

    To start navigation, there are several methods available. Generally, the method you should use is routeFind(@NotNull String poiId, @NotNull RouteOptions options, boolean previewRoute, boolean startRoute, RouteCallback routeCallback). This method allows you to find a route:

    The RouteCallback object give you access to current status of navigation (gives you access to information about the route and current state of navigation). For more info see the docs for RouteCallback.

    There are several other convenience methods that:

    Note that calling the routeFind(...) method repeatedly will cancel the current route (only the last route is kept).

    When route was calculated, you can manage the navigation state using following methods:

    During navigation, you can register several callbacks:

    In case you need to just calculate a 'throwaway' route, you can use the alternative routeCalculate(..) method. Keep in mind you can not start navigation on route calculated by this method but this calculation will not interfere with the currenly running navigation.


    The ProximiioMapbox helper provides a broad configuration options to customize your navigation experience.

    You can configure TTS with following options:

    Navigation - you can customize the navigation experience using the following settings:

    You can also customize the current location marker (mapbox's location component) by supplying a MapboxLocationComponentActivator object during map initialization with onMapReady(MapboxMap mapboxMap, MapboxLocationComponentActivator activator) alternate method. Overriding its method allows you full ability to change mapbox's location component to your desired configuration.

    Custom Markers

    In order to add custom markers on the map we can refer to MapLibre legacy logic. In our demo application you can find a full implementation that makes use of LiveData logic to be reactive.

    Another example can be found in MapLibre demo app.

    Here a little snippet you can use:

    mapboxMap.getStyle { style ->
            this.getResources(), R.drawable.iss))
        val source = GeoJsonSource("marker-source-id").apply { style.addSource(this) }
        style.addLayer(SymbolLayer("marker-layer-id", "marker-source-id").withProperties(
            Point.fromLngLat(24.921695923476054, 60.1671950369849)

    If you want to interecpt a tap on a marker, we need to introduce a check in our addOnMapClickListener.

    An example of handler can be like this:

    .map { poi -> viewModel.markersLiveData.value!!.firstOrNull { == } }
    .firstOrNull()?.let { feature ->
        // handle here tap on marker
        Log.d("MARKER", feature.toString())
    } != null

    If you need to manage also data a good advice is to create a data class with feature as parameter, an identifier to be able to easily reconsolidate the data on tap as above and your extra data needed. A detailed example is available in the demo app.


    See documentation here.