Getting started
The Wemap SDKs provide comprehensive location tracking, routing, and navigation capabilities for mobile applications. This guide will help you get started with the SDKs, focusing on the positioning package.
Overview
The Wemap SDKs are organized into several libraries:
- WemapCoreSDK: Common types, foundation for all other SDKs
- WemapPositioningSDK: Location tracking and positioning
- WemapMapSDK: Custom interactive maps
- WemapGeoARSDK: Routing and navigation in AR
Requirements
Different Wemap SDKs have different requirements, but these are the common requirements applied to all of them.
- Android SDK 23 or newer (Android 6.0 or newer) — 24 for the GeoAR and VPS SDKs
- Kotlin 2.2 or newer
- Java 11 or newer for source and target compatibility (the GeoAR SDK requires Java 17)
Installation
Before you start developing your application with WemapSDKs, you need to add the SDK as a dependency.
Adding the Dependency
To add WemapSDKs to your app:
-
Wemap provides WemapSDKs via Maven Repository. Specify it in
project/settings.gradledependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {google()mavenCentral()// Wemap Maven repositorymaven {url "https://s3.eu-west-1.amazonaws.com/mobile.getwemap.com/releases/android"}}} -
In your module-level Gradle file (usually
project/module/build.gradle.ktsorproject/module/build.gradle), add the required WemapSDK dependency to your app:dependencies {// to use Wemap custom interactive mapsimplementation "com.getwemap.sdk:map:<version>"// add this too if your UI is Jetpack Compose — see Documentation/mapsdk-compose.mdimplementation "com.getwemap.sdk:map-compose:<version>"// to use Wemap GeoAR for navigationimplementation "com.getwemap.sdk:geo-ar:<version>"// add this too if your UI is Jetpack Compose — see Documentation/geoarsdk-compose.mdimplementation "com.getwemap.sdk:geo-ar-compose:<version>"// Add the dependency for the WemapPositioningSDK libraryimplementation "com.getwemap.sdk.positioning:wemap-vps-arcore:<version>" // Wemap VPS ARCore Location Source (best for indoor)implementation "com.getwemap.sdk.positioning:android-fused-adaptive:<version>" // Adaptive Fused Location Source (Google or system, best for outdoor)} -
Ensure that your project's
minSdkversion is set to API 23 or higher (24 if you use the GeoAR SDK or either VPS positioning source):android {...defaultConfig {minSdk 23}} -
Since you've modified your Gradle files, Android Studio will prompt you to sync the Gradle files. Proceed with syncing.
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 (see the MapSDK guide)
}.onFailure {
println("Failed to create session with error - ${it.message}")
}
}
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()).
Examples
For additional examples and sample implementations of WemapSDKs, visit the official GitHub repository.
Clone the repository and follow the README instructions to run the sample application.