Android Compose | Mobile SDK | Urbi Documentation
Android SDK

Android Compose

Android Compose (Jetpack Compose) is a toolkit for creating UI in Android applications developed in Kotlin. Unlike Android View, this framework follows the declarative approach to describing the interface.

The compose-map module for Android Compose by Urbi contains a standard set of UI controls for managing the map. The module is available for both Full and Map versions of the SDK.

To add the module to your application:

  1. Add the following elements to app/build.gradle and specify the number and type of the SDK version (both parameters are mandatory):

    dependencies {
    
        def sdkVersion = "12.4.0" // SDK version number
    
        implementation("ru.dgis.sdk:sdk-map:$sdkVersion") // Specify sdk-map or sdk-full
        implementation("ru.dgis.sdk:compose-map:$sdkVersion")
    }
    

    See an example of a prepared app/build.gradle in the demo project on GitHub.

  2. Get the map using MapComposable. The map is then used when adding UI elements.

    See the map preparation example.

The standard set contains the following controls:

  1. IndoorComposable to switch floors.
  2. TrafficComposable to display the current traffic jam score and manage the visibility of traffic jams on the map.
  3. ZoomComposable to scale the map (zoom in and out).
  4. CompassComposable to manage the compass that shows the current map azimuth.
  5. MyLocationComposable to fly to the current user location. This UI control displays the current camera follow state (CameraFollowState) and enables changing it.