Skip to main content

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:

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 configure your credentials and add the SDK as a dependency.

Configure credentials

Wemap provides WemapSDKs via CocoaPods, and you will need to obtain secret and access keys to access them. For additional information, please contact Wemap team.

Once you have the credentials, specify accessKey and secretKey in project/settings.gradle

maven {
url "s3://mobile-dev.getwemap.com/wemap/sdk/android"
credentials(AwsCredentials) {
accessKey System.getenv("AWS_ACCESS_KEY_ID") // Put your access key here or export it as an environment variable
secretKey System.getenv("AWS_SECRET_ACCESS_KEY") // Put your secret key here or export it as an environment variable
}
}

Adding the Dependency

To add WemapSDKs to your app:

  1. In your module-level Gradle file (usually project/module/build.gradle.kts or project/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)
    implementation "com.getwemap.sdk.positioning:polestar:<version>" // Polestar Location Source
    }
  2. Ensure that your project's minSdk version is set to API 23 or higher:

    android {
    ...
    defaultConfig {
    minSdk 23
    }
    }
  3. 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

ServiceFactory
.getMapService()
.mapById(19158, "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapID and token here
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ mapData ->
// now you have MapData and can use it to continue with any WemapSDK
}, {
println("Failed to get map data with error - $it")
})
.disposedBy(disposeBag)

WemapMapSDK

WemapMapSDK.instance
.mapData(19158, "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapID and token here
.subscribe({
// now you have MapData and can use it to continue with any WemapSDK
}, {
println("Failed to get map data with error - ${it.message}")
})
.disposedBy(disposeBag)

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.