Skip to content

Overview

Pointr Mobile SDK is the framework you need to build applications that make use of Pointr Maps Platform. Indoor and outdoor positioning and maps, turn-by-turn navigation and several other features are available on the Pointr Mobile SDK and the rest of the platform.

For more information and to get started quickly, please refer to the Quick Start section.

Interaction with Pointr Cloud

Pointr Mobile SDK needs Pointr Cloud to work, as the diagram below shows.

Also not shown on the diagram, but important to know:

  1. On the very first run, the Pointr Mobile SDK validates the license key with Pointr Cloud (requires internet connection). Until the license validation is complete, the SDK won’t work even if it has all the content data bundled in the application. After initial validation, Pointr Mobile SDK can work offline, without any need to verify the license for 7 days.

  2. Pointr Cloud can remotely change configuration settings for Pointr Mobile SDK, mostly to avoid having to update the application due to minor changes. All that the administrator needs to do is to change the setting on Pointr Cloud, and within 15 minutes the changes are going to take effect on the application.

Pointr Mobile SDK Main Features

  • Get user’s location.
  • Display maps with points of interest and user’s location.
  • Search for points of interest.
  • Way-finding to any location on the map (between two locations of a site).
  • Detect when the user enters or exits a particular area (geofencing).

Pointr SDK Size Tables

iOS SDK Size Table

Sizes depend on the OS version, device model and architecture. This list is referring to the maximum sizes.

For more information check Apple’s developer portal.

iOS Version Pointr SDK (Compressed Size) Pointr SDK (Uncompressed Size) Maplibre SDK (Compressed Size) Maplibre SDK (Uncompressed Size) Pointr + Maplibre (Compressed Size) Pointr + Maplibre (Uncompressed Size)
iOS 11.0, 12.0 5.1 MB 12.5 MB 2.7 MB 8.1 MB 7.6 MB 20.5 MB
iOS 12.2 4.8 MB 11.3 MB 2.7 MB 8.1 MB 7.5 MB 19.4 MB
iOS 13.0, 14.0 4.8 MB 11.3 MB 2.7 MB 8.1 MB 7.5 MB 19.4 MB
iOS 15.0, 16.0 4.8 MB 11.3 MB 2.7 MB 8.1 MB 7.5 MB 19.4 MB
Universal 12.1 MB 26.1 MB 5.7 MB 15.8 MB 17.9 MB 41.9 MB
Empty project Project With Pointr Project With Pointr Per CPU Architecture
App Bundle Size 3.7 MB (~2 MB with Proguard) 26.6 MB (~25 MB with Proguard) 11-12 MB (~9-10 MB with Proguard)

Anroid SDK Size Table

On Android, the only supported way of distribution on Google Play is using Android Bundle’s since August 2021. This helps minimize the size app’s take on devices by splitting them by architecture upon delivery. Hence, below you can find the table including size information separated by device architectures. We have mentioned the Maplibre SDK size and Pointr SDK size separately as Maplibre is currently our mapping provider which too takes space on device. On the last column, there is the ‘Delivery size’ which is calculated by Google Play that signifies the size Pointr SDK takes upon delivery on Google play downloads.

Note

The reason Universal architecture size is not equal to exactly the sum of all other mentioned architectures is that there are resources shared between architectures.

Architecture Pointr SDK Size Maplibre SDK Size Total Size Delivery Size
x86 5.7 MB 3.2 MB 9 MB -
x86_64 5.7 MB 3.2 MB 8.9 MB -
arm64-v8a 5.5 MB 3 MB 8.5 MB -
armeabi-v7a 5.3 MB 2.7 MB 7.9 MB -
Universal 13.2 MB 12.1 MB 25.3 MB ~8.82 MB
Sample App IPA size Sample App IPA size with Maplibre Sample App IPA size with Pointr SDK and Maplibre
218 KB 219 KB 10 MB

Privacy Information

The SDK does NOT collect any personal data. Users don’t have a login or any other way that would allow Pointr to identify them. Pointr only has access to Device ID, so a user with two devices is the same as two users with one device each.

The Device IDs used by Pointr are generated based on best practices suggested by mobile platforms. Device IDs ensures uniqueness of the application in use. Using Device ID, Pointr Cloud can relate data to a unique application using Pointr Mobile SDK. Device IDs cannot be used actually to track the precise phone of origin. The Device IDs we have, cannot be used with an algorithm that would allows us to get the device’s phone number, owner’s name, serial number or any other information that could lead to a privacy breach. For more information about Device IDs can be found here.

Quick Start

Prerequisites

For both versions of the SDK you will need:

  • Access token or username and password if using Android Artifactory or iOS Cocoapods.
  • License Key of the environment you will use (Dev, Prod, QA, etc…) on Pointr Cloud.
  • Android or iPhone devices to test the mobile app in case you use location related features.

Warning

The mobile SDK uses Maplibre maps that currently show performance and stability limitations when running on the simulator on M1 macs.

  • Pointr Android SDK can be shared in two ways,
    • From artifactory server which serves over https. For details see.
    • If you don’t access the SDK over artifactory due to various reasons, you can also obtain the required .aar files to integrate the Pointr Android SDK
  • Android Studio 3.0 or later
  • Gradle 4.1 or later
  • Certificate file
  • SDK file, shared as either:
    • CocoaPods POINTR_SDK_TOKEN. For details see; or
    • .framework file
  • XCode 11.x or later

Download a Sample Project

To download a working sample project using Pointr SDK, please refer to here.

Add SDK to your Own Project

Add using Gradle Maven

Step 1

Add pointr artifactory to your project’s top level build.gradle file.

allprojects {
    repositories {
        ... // other repositories
        maven {
            url "https://android.pointr.dev/artifactory/gradle-release-local"
            credentials {
                username 'YOUR_USER_NAME'
                password 'YOUR_ARTIFACTORY_PASS'
            }
        }

Note

If you are using gradle version 7+, the project might have the project level remote repository url’s in “settings.gradle” instead of the project’s top level “build.gradle” file. If this is the case, you should add the Pointr repository under there as below;

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://android.pointr.dev/artifactory/gradle-release-local"
            credentials {
                username 'YOUR_USER_NAME'
                password 'YOUR_ARTIFACTORY_PASS'
            }
        }
    }
}

However, Google official documentation still suggests to keep them in the project level “build.gradle”.

To access the Pointr Android SDK you need to update the credentials marked “YOUR_USER_NAME” and “YOUR_ARTIFACTORY_PASS”. To get the artifactory credentials, contact your project manager.

Step 2

Add Pointr Android SDK to your module level dependencies. You can check the latest version from here

implementation 'com.pointrlabs:pointr:<add latest version of Pointr SDK here>'

Step 3

Sync your project with new gradle files to start downloading the Pointr SDK and get all dependencies.

Note

Adding .aar manually is currently not supported.

You can either use CocoaPods or Manually add the Framework to integrate with your project.

Add using Cocoapods

  • Request an access token (POINTR_SDK_TOKEN) from your customer support team.

  • Add the following to your Podfile:

# Add this line to top of your `Podfile` as a source
source "https://github.com/pointrlabs/public-podspecs.git"

# Add this in targets you want to add PointrKit
ENV['POINTR_SDK_TOKEN'] = '$YOUR_ACCESS_TOKEN'
pod 'PointrKit', ''add latest version of Pointr SDK here”
  • Run pod install to integrate SDK.

Manually add the Framework

Download the latest Pointr iOS SDK and then drag and drop the PointrKit.xcframework and Mapbox.xcframework (Maplibre library) into your Xcode project. Select Embed & Sign on the Embed options.

Putting the PointrContent.zip inside the app (This step is optional for version 8.1.0 and later. Check Start Pointr section to learn how to start the SDK without the zip file.):

Warning

PointrContent.zip is not support for SDK version 8.14 and above.

Please follow the steps below, to make sure that you add the PointrContent.zip correctly inside the app:

  • Please visit this link: Where can I find pointrcontent.zip to see how to get the PointrContent.zip
  • Remember that the suffix signifies the environment the content is connected to. The SDK will check the zip with the associated environment given to the Pointr.with method as an argument.
  • Put the PointrContent zip anywhere inside the Xcode project, as long as it is included in the application’s bundle.
  • Do not change the name of the Pointr Content zip to change environments.
  • To switch between environments, change the Environment parameter supplied to Pointr.with

Start Pointr

Before you display a map, start listening to the user’s location, or do any other action, you first need to start the Pointr SDK and make sure it’s on running state.

Note

Pointr will provide you with a Client ID, License Key, and API endpoint to fetch your content. To get started without this, please download our sample projects on the Downloads section.

Before you use most of Pointr features you need to get it into a RUNNING state, this is done with a method called Pointr.with that takes an argument with some parameters.

The most important parameters are the license key and environment settings, those are needed to connect to Pointr Cloud. To set the url and client identifier you can either import the PointrContent.zip provided by us or you can set the values when initialising the SDK.

Warning

PointrContent.zip is not support for SDK version 8.14 and above.

Example when using PointrContent.zip:

val ptrParams = PTRParams()
ptrParams.environment = PointrEnvironment.PROD
ptrParams.licenseKey = "PROD_LICENCE_KEY"
ptrParams.logLevel = PLog.LogLevel.WARNING

Example when setting the values on code (for version 8.1.0 and later):

val ptrParams = PTRParams("YOUR_CLIENT_ID", "PROD_LICENCE_KEY", "YOUR_POINTR_CLOUD_API_URL")
ptrParams.logLevel = PLog.LogLevel.WARNING

Other fields of the ptrParams class can be modified to configure your Pointr instance as needed (e.g., the path to PointrContent zip files, the path to cacert.pem file). If these are not customized, the default location will be used, which is the “Assets” folder.

Example code of Pointr.with method using the parameters created previously.

Pointr.with(
    applicationContext,
    ptrParams
)

After this, you will be able to get a valid instance of Pointr using the static Pointr.getPointr() method anywhere. The two pieces of code that were just shown should run only once, yet they should run, one possible location for them is right when the application starts, or on some event that happens only once, or only the first time, when the user is about to use Pointr.

To utilize the Pointr Managers, you need to make sure that Pointr is RUNNING. To run Pointr, call Pointr.getPointr()?.start() method and retrieve state updates by subscribing a PointrListener to Pointr. If Pointr.with wasn’t called before you attempt to use getPointr() you might cause an exception or application crash as it attempts to access a non-existing object instance.

Below is an example of how to implement this:

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.pointrlabs.core.management.Pointr
import com.pointrlabs.core.management.interfaces.PointrListener
import com.pointrlabs.sample.R

/**
* Activity to start Pointr
*/
class PointrLoadingActivity : AppCompatActivity() {
    private val pointrListener = object : PointrListener {
        override fun onStateUpdated(state: Pointr.State?) {
            if (state == Pointr.State.RUNNING) {
                onPointrRunning()
                Pointr.getPointr()?.removeListener(this)
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.layout_of_activity)
        val pointr = Pointr.getPointr()
        pointr?.addListener(pointrListener)
        pointr?.start()
        if (pointr?.state == Pointr.State.RUNNING) {
            onPointrRunning()
        }
    }

    private fun onPointrRunning() {
        // Do operations with Pointr Managers
        // Show map etc.
    }
}

You should replace the “R.layout.layout_of_activity” line with an actual layout that exists in your project, for example R.layout.main_activity if you are using the “Empty Activity” template. Then you should replace the “import com.pointrlabs.sample.R” with the “R” path of your project.

To start using Pointr methods, you will first need to initialize a Pointr instance. To initialize with Pointr.shared.start(with:onStateChanged:) method, you will need to create a PTRParams instance with necessary parameters.

Warning

PointrContent.zip is not support for SDK version 8.14 and above.

Example when using PointrContent.zip:

let params = PTRParams()
params.mode = PointrDebugMode()
params.environment = PTREnvironment.internal
params.licenseKey = "YOUR_LICENSE_KEY"
params.loggerLevel = .info

Example when setting the values on code (for version 8.1.0 and later):

let params = PTRParams()
params.mode = PointrDebugMode()
params.baseUrl = "YOUR_POINTR_CLOUD_API_URL"
params.clientIdentifier = "YOUR_CLIENT_ID"
params.licenseKey = "YOUR_LICENSE_KEY"
params.loggerLevel = .info

Other fields of the params class can be modified to configure your Pointr instance as needed (e.g., the path to PointrContent zip files etc.). If resourceFolder is not customized, the default location will be used, which is Bundle.main.bundlePath.

To utilize the Pointr Managers, you need to make sure that Pointr State is at the Running stage. This can be achieved by using Pointr.shared.start(with:onStateChanged:) method’s onStateChanged callback. You can also validate if Pointr is Running by checking the State field (i.e., Pointr.shared.state == PointrState.running).

Note

Once in the RUNNING state, Pointr remains active until terminated or pointr.stop() is called. Other states are for initialization or failure modes, with no state beyond RUNNING. The start() method initiates Pointr, and stop() halts the SDK, stopping background services and user location calculations. Restarting Pointr takes about 3-4 seconds due to prior validation and data storage.

Note

The PTRParams class includes a logging level parameter, which is logLevel on Android and loggerLevel on iOS, defaulting to .verbose. Logging levels, from most to least information, are: .all (iOS only), .verbose, .info, .warning, .error, .off (iOS only). The debug level is automatic on iOS and below .verbose on Android.

Display a Map

While you don’t necessarily will display a map in your production project using Pointr SDK, displaying a map will show you how to do something simple, but that allows you to see if Pointr SDK and Pointr Cloud has been setup correctly or not.

After confirming your Pointr state is Running; to show the maps, you need to use PTRMapWidgetFragment and PTRMapWidgetConfiguration.

PTRMapWidgetConfiguration

PTRMapWidgetConfiguration is a class that allows you to customize Pointr Map Widget components and their behavior. This class will be passed to PTRMapWidgetFragment initializer to define the specifications of the Pointr Map Widget.

PTRMapWidgetFragment

To be able to show the Pointr MapWidget, you need to have a FrameLayout fragment to serve as a container for the Pointr Map. This layout can be hosted in a fragment or an activity, that is up to the implementer.

Note

If it is going to be hosted in an activity, this activity needs to be declared in the application’s AndroidManifest file.

If you created a fragment used the GUI editor, ensure you use the code below with a FrameLayout, adding a PTRMapWidgetFragment with the GUI and then using the code below will result in one Map Widget inside another, and a lot of issues and bugs.

Example Code to show the map, considering the FrameLayout has the id: R.id.fragment_container:

// This line creates a mapWidgetConfiguration to configure the Pointr Map as per your needs.
val mapWidgetConfiguration = PTRMapWidgetConfiguration.defaultConfiguration()
val mapWidgetFragment = PTRMapWidgetFragment.newInstance(mapWidgetConfiguration)
    .show(supportFragmentManager, R.id.fragment_container)

Show a Building

After creating the map widget instance, you can display a building in it (or map widget will display a world map, not a specific building), using building and site external identifiers which you can learn from your Pointr Cloud instance.

Example Code
// The call to display a building in map widget
mapWidgetFragment?.showBuilding("your_site_ext_id", "your_building_ext_id")

After confirming your Pointr state is Running; to show the maps, you need to use PTRMapWidgetViewController and PTRMapWidgetConfiguration. PTRMapWidgetConfiguration is a class that allows you to customize Pointr map widget components and their behavior.

Example Code

// This line creates a mapWidgetConfiguration to configure the Pointr Map as per your needs.

let configuration = PTRMapWidgetConfiguration()
let mapWidget = PTRMapWidgetViewController(configuration: configuration)

After creating the map widget instance, you can display a building in it (or map widget will display a world map, not a specific building), using building and site external identifiers which you can learn from your Pointr Cloud instance.

Example Code

mapWidget.showBuilding(siteExternalIdentifier: "your_site_ext_id", buildingExternalIdentifier: "your_building_ext_id")
navigationController?.present(mapWidget, animated: true, completion: nil)

Last update: October 10, 2024
Back to top