Skip to main content
Version: 1.x

Getting Started with Wemap SDKs

Location tracking, routing, and navigation for Android.

Overview​

The Wemap SDKs provide comprehensive location, routing, and navigation capabilities for Android apps. They are distributed as several libraries that share a single session:

  • WemapCoreSDK — common types and the foundation for all other SDKs (API access, routing, POIs).
  • WemapMapSDK — customizable, interactive maps built on MapLibre.
  • WemapMapComposeSDK — Jetpack Compose support for the Map SDK (WemapMap). Optional and separate, so View-based apps never depend on the Compose runtime.
  • WemapGeoARSDK — augmented-reality navigation and points of interest.
  • WemapGeoARComposeSDK — Jetpack Compose support for the GeoAR SDK (WemapGeoAR).
  • WemapPositioningSDK — indoor/outdoor positioning:
    • VPS ARCore — visual positioning system, camera-based (best for indoor).
    • VPS Local — offline visual positioning, camera-based, with no network. Alpha, on a version of its own, and needs a map database for your venue — see the note under Installation.
    • GPS — global positioning system (best for outdoor).
    • Fused GMS — Google Play Services fused location (best for outdoor).
    • Android Fused Adaptive — adaptive fused location (Google Play Services or system, best for outdoor).
  • WemapMapWidgetsSDK — ready-made map controls in Jetpack Compose and Views: the levels rail and the itinerary form. Versioned separately — see Map widgets.

Upgrading from 0.x​

v1 is a breaking release. Migrating to v1 walks through it in twelve steps, each of which leaves your project compiling, and ends with an index from compiler error to step number.

Requirements​

Wemap SDKcompileSdkminSdkKotlinAndroid Gradle pluginJava/JVM
1.x3724 (Android 7.0)2.2+9.1+11

The GeoAR SDK and its Compose companion (ARCore/SceneView) also need Java 17. Every other module targets Java 11.

The two Compose modules additionally need a Compose BOM of 2026.09.00 or newer. They require no newer AGP or compileSdk than the rest of the SDK.

minSdk and the JVM target stay the same for every 1.x release. A 1.x minor release may raise the Kotlin and Android Gradle plugin minimums, never a patch release, and the compileSdk minimum rises when a dependency requires it; the CHANGELOG says so. What v1 covers lists everything 1.x keeps and what it may add.

Installation​

Add the SDK as a dependency via Gradle.

  1. Declare the Wemap Maven repository in settings.gradle.kts:

    dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
    google()
    mavenCentral()
    // Wemap Maven repository
    maven("https://s3.eu-west-1.amazonaws.com/mobile.getwemap.com/releases/android")
    }
    }
  2. Add the modules you need to your module-level build.gradle.kts:

    dependencies {
    // interactive maps
    implementation("com.getwemap.sdk:map:<version>")
    // ...plus this one if you use Jetpack Compose
    implementation("com.getwemap.sdk:map-compose:<version>")

    // AR navigation
    implementation("com.getwemap.sdk:geo-ar:<version>")
    // ...plus this one if you use Jetpack Compose
    implementation("com.getwemap.sdk:geo-ar-compose:<version>")

    // positioning — VPS (indoor)
    implementation("com.getwemap.sdk.positioning:wemap-vps-arcore:<version>")
    // positioning — adaptive fused (outdoor)
    implementation("com.getwemap.sdk.positioning:android-fused-adaptive:<version>")

    // positioning — offline VPS (indoor, no network). Alpha, and on a version line of its own:
    // use its own `<alpha-version>`, NOT the one above. See the note below before adding it.
    implementation("com.getwemap.sdk.positioning:wemap-vps-local:<alpha-version>")
    }

    wemap-vps-local is alpha and needs data from us. Its whole public API requires an explicit opt-in, it does not follow semantic versioning — any declaration may change or disappear in any release, including a patch — and it carries its own -alpha.N version rather than the one every other module shares. It also positions against a pre-built map database for your venue, which we build and provide; without one the location source has nothing to match camera frames against. Talk to us before building on it.

    On a Mac with an Apple M4-series chip, run it on an API 37 emulator image or a device. Every arm64 emulator image up to API 36 runs a Linux kernel that reports SVE2 support the M4 does not have, and the OpenCV build this module packages then crashes with SIGILL when a scan starts. Physical devices and M1–M3 Macs are not affected.

  3. Ensure your app's minSdk is at least 24:

    android {
    defaultConfig {
    minSdk = 24
    }
    }

Map widgets​

com.getwemap.sdk:map-widgets is on a 0.x version line of its own: any release may change its API, so declare an exact version. Each widgets release is built against one release of the SDKs, named under Dependencies in the widgets change log, and brings in com.getwemap.sdk:map at that version for you. If you also declare the SDKs, keep them at that version: Gradle resolves the higher of the two, and the widgets are only tested against their own.

dependencies {
implementation("com.getwemap.sdk:map-widgets:0.3.0")
}

Creating a session​

Every Wemap SDK is driven by a session. A session loads a map's data once and owns the shared state the SDKs build on (routing, POIs, positioning). Create one session and pass it to each component you use — the shared instance is what keeps navigation, POI selection, and user location consistent across the map, AR, and positioning SDKs.

You must have a mapId and token to create a session. For more details, please contact the Wemap team.

create is a suspending function (it fetches the map from the backend), so call it from a coroutine. Below are examples of how to create a session using different SDKs.

WemapPositioningSDK or WemapCoreSDK​

lifecycleScope.launch {
runCatching {
CoreSession.create(context, 19158, "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapId and token here
}.onSuccess { session ->
// now you have a session and can use it to continue with any WemapSDK
}.onFailure {
println("Failed to create session with error - $it")
}
}

WemapMapSDK​

lifecycleScope.launch {
runCatching {
MapSession.create(context, 19158, "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapId and token here
}.onSuccess { session ->
// now you have a session and can pass it to a WemapMapView
mapView.configure(session)
}.onFailure {
println("Failed to create session with error - ${it.message}")
}
}

The MapSDK guide goes on from there.

The session is the sole owner of its services. When the screen that owns it goes away, tear it down with session.deinit() — typically from the lifecycle owner that holds it (e.g. a ViewModel.onCleared()).

Collecting the SDK's streams​

Every SDK callback is a Kotlin Flow you collect on your own scope — from a Fragment, on viewLifecycleOwner.lifecycleScope, inside repeatOnLifecycle(Lifecycle.State.STARTED). They all keep the same contract, the one the iOS SDK's AsyncStreams keep:

  • Every collector gets every value the stream delivers to it, and one slow collector never costs another a value.
  • Values arrive in your collector's own coroutine context. No thread is promised, and neither is an order across two streams.
  • Errors are values. No stream ever ends with an exception.
  • A stream ends when its owner does. A Flow completes when its view is destroyed, when the last view sharing a manager is destroyed, or when its location source is deinitialized; the location streams complete when the session is deinitialized. A StateFlow never completes — that is the StateFlow contract, and the one difference from iOS, where every stream finishes.

Each stream is one of three kinds, and its reference documentation says which:

KindExamplesA new collector getsWhen a collector falls behind
State — what something is nowthe StateFlows loadPhases, focusedBuildings, locationStates, states, scanStatuses, cameraTrackingStates; and cameraStates(…), which completes with its viewthe current valueit skips to the newest; a value arrives only when it changes
Event — what happenednavigationEvents, navigationInfoUpdates, selectionUpdates, touchedPois, visibilityUpdates, activeLevelChanges, touchedPoints, userLocalizationUpdates, scanOutcomes, every errorsnothing — read the matching property, such as getVisiblePois(), for the current valueup to 8 values wait for it; past that the oldest is dropped and the drop logged
Measurement — where the user iscoordinates, attitudesthe latest value, unless the location source has stopped sinceit keeps the newest 8 coordinates, or the newest attitude

The location streams — coordinates, attitudes and errors — belong to the session, not to a location source: every location source, UserLocationManager and ARLocationManager of a session hand out the same streams, fed by whichever source is active.

Handling SDK enums and sealed types​

During 1.x, a minor release may add a case to any public enum-like type or sealed type of the SDKs: an error, an event, a positioning state or a step direction. A new case is not a breaking change, so every when over one keeps an else branch for the cases it doesn't know yet — and the compiler asks for it:

fun handle(error: DirectionsServiceError) {
when (error) {
is DirectionsServiceError.NoItinerariesFound -> showNoRouteMessage()
is DirectionsServiceError.RequestFailed -> showGenericError(error.reason)
else -> showGenericError(null) // the other cases, and any a later 1.x release adds
}
}

fun render(status: VpsARCoreLocationSource.ScanStatus) {
when (status) {
VpsARCoreLocationSource.ScanStatus.Started -> showScanning()
VpsARCoreLocationSource.ScanStatus.Stopped -> hideScanning()
else -> hideScanning()
}
}

The enum-like types, such as ScanStatus, Step.Direction or UserLocationState, are value classes with PascalCase constants, so they have no entries or valueOf. Where a type offers is… properties, such as isStarted or isStale, you can use them instead of a when. A value the backend sends that your SDK version doesn't know yet — a new step direction, say — reaches that else branch rather than failing the request.

Two types are closed and will not change in 1.x: LoadPhase and Levels. A when over either can list every case with no else.

Reporting a crash​

The SDK's internals are obfuscated, so a stack trace through them shows short, renamed classes. Send it to Wemap as your crash reporter (Play Console, Crashlytics) displays it, together with the SDK version — we decode the SDK's frames on our side.

Examples​

For sample implementations, see the official sample-apps repository. Clone it and follow its README to run the sample apps.