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)
- Kotlin 1.9.25 or newer
- Java 8 or newer for source and target compatibility
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 repository
maven {
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 maps
implementation "com.getwemap.sdk:map:<version>"
// to use Wemap GeoAR for navigation
implementation "com.getwemap.sdk:geo-ar:<version>"
// Add the dependency for the WemapPositioningSDK library
implementation "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:android {
...
defaultConfig {
minSdk 23
}
}Since you've modified your Gradle files, Android Studio will prompt you to sync the Gradle files. Proceed with syncing.
Fetching MapData
MapData is a configuration object crucial for any WemapSDK initialization.
You must have a mapID and token to request this object.
For more details, please contact the Wemap team.
Below there are examples of how to fetch MapData object using different SDKs.
WemapPositioningSDK or WemapCoreSDK
lifecycleScope.launch {
runCatching {
ServiceFactory
.getMapService()
.mapById(19158, "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapID and token here
}.onSuccess {
// now you have MapData and can use it to continue with any WemapSDK
}.onFailure {
println("Failed to get map data with error - $it")
}
}
WemapMapSDK
lifecycleScope.launch {
runCatching {
WemapMapSDK.instance
.mapData(19158, "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapID and token here
}.onSuccess {
// now you have MapData and can use it to continue with any WemapSDK
}.onFailure {
println("Failed to get map data with error - ${it.message}")
}
}
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.