Skip to content
Cuong edited this page Jun 26, 2019 · 43 revisions

Overview

Mist provides indoor blue dot navigation experience with 16 vBLE antenna array in Mist Access Point. This guide will provide detailed information on our Android SDK. It will help you configure application to integrate Mist SDK and initialize location services.

Requirements

  • Android Studio: 3.0+ - This document assumes that reader has basic knowledge of Android development.
  • Minimum Android SDK: API 21
  • Target Android SDK: API 271
  • Latest Mist SDK: 2.0

1. If your app is targeting API level 28 (Android 9.0) or above, you must include the following declaration within the element of AndroidManifest.xml. <uses-library android:name="org.apache.http.legacy" android:required="false" />

Integrate MistSDK

Our SDK can be integrate by using one of the following ways:

JCenter (Recommended)

Add the following in your app module build.gradle, This will take care of both Mist Core SDK and DR SDK

implementation 'com.mist:core-sdk:2.0.0’

or

Manual Adding sdk_framework.aar

While manually setting up SDK, include both 'Mist Core SDK' and 'DR SDK' in you application project.

  • Download 'sdk-framework.aar' and 'mist-mobile.aar' from SDK Releases
  • Add following to app/build.gradle in dependencies
implementation(name:'sdk_framework', ext:'aar')
implementation(name:'mist-mobile', ext:'aar')
implementation fileTree(include: ['*.jar'], dir: 'libs')

In project/build.gradle, add following in repositories

flatDir { dirs 'libs'}

For more details please refer to one of the Sample Apps

Initialize SDK

To initialize Mist SDK you need organization secret and organization id.

  1. Obtain the invitation token from the Mist portal at the following path: Organization -> Mobile SDK. Use the token to obtain the org_id and secret via onReceivedSecret callback:
MSTOrgCredentialsManager.enrollDeviceWithToken(this,secret, new MSTOrgCredentialsCallback() {
    /**
        * @param orgName   Organization Name for the QR code
        * @param orgID     Organization ID for the QR code
        * @param sdkSecret SDK secret token to be used to connect to Mist
        * @param error     Error if the information cannot be found
        */
    @Override
    public void onReceivedSecret(String orgName, String orgID, String sdkSecret, String error,String envType) {
        //
    }
});
  1. Use the org_id and secret for starting the SDK and implements the CentralManagerIndoorOnlyListener callbacks:
    MSTCentralManager mstCentralManager = new MSTCentralManager (application, orgID, orgSecret, 
    mstCentralManagerIndoorOnlyListener);
  2. Call start API of MSTCentralManager to start the SDK:
    mstCentralManager.start();
  3. Call stop on MSTCentralManager to stop receiving callbacks from Mist SDK:
    mstCentralManager.stop();

Getting Location Info

Location response is used to know the position of the user in that particular floorplan. To get location information from Mist SDK implement MSTCentralManagerIndoorOnlyListener callbacks in your application. Following callback returns updated location of the device as a point (X,Y) measured in meters from the map origin:

Relative coordinates based on top-left origin in meters (x, y)

onRelativeLocationUpdated(MSTPoint relativeLocation, MSTMap[] maps, Date dateUpdated)

The current map can be retrieved by maps[0].

relativeLocation object contains the following user information:

  • x, y: user location
  • hasMotion: is the user in motion ,
  • mstPointType: type Cloud,
  • latency: latency in the network,
  • heading: compass heading,
  • headingFlag: availability of compass heading

Lat/Long coordinate

onDRRelativeLocationUpdated(JSONObject drInfo, MSTMap mstMap, Date date)

The latitude and longitude coordinate can be found inside the JSONObject.

{
  "Raw": {
    "Lat": 36.562600,
    "Lon": -118.957490,
  },
  "Snapped": {
    "Lat": 36.562600,
    "Lon": -118.957490,
  }
}

For more detail, you can see the implementation in the sample app here

Release Notes

Release Notes

Getting Started

Integration Guide

Clone this wiki locally