-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Mist SDK provides indoor bluedot experience using Mist’s 16 vBLE antenna array Access point. Using this SDK you will know user's location and can provide proximity related notification using Mist patented vBeacon technology.
- minSDK : API 21
- targetSDK : API 27
- Android Studio : 3.0+
Note: If your app is targeting API level 28 (Android 9.0) or above, you must include the following declaration
within the <application> element of AndroidManifest.xml.
<uses-library android:name="org.apache.http.legacy" android:required="false" />
- Location
- Internet
- Bluetooth
There are two ways to integrate Mist SDK.
- From Jcenter (Recommended)
- Manual adding of .aar to project from here
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’
To integrate with Mist SDK you need to include both 'Core SDK' and 'DR SDK' libraries in your Application project.
For integrating Mist core SDK you need to download the 'sdk_framework.aar' from the SDK release folder and place it in libs folder of your application than add following lines in their build.gradle
implementation(name:‘sdk_framework’, ext:‘aar’)
For integrating DR SDK you need to download the 'mist-mobile.aar' from the SDK release folder and place it in libs folder of your application than add following lines in their build.gradle
implementation(name:‘mist-mobile’, ext:‘aar’)
Also, make sure to add the following in build.gradle so that above libraries can be located and used while compilation
Under dependencies block
implementation fileTree(include: [‘*.jar’], dir: ‘libs’)
Under repositories block
flatDir {
dirs ‘libs’
}
For more details please refer to one of the Sample Apps.
To initialize Mist SDK you need Organization Secret and Organization Id. To get these details you have to enroll the Device with the Invitation Secret.
Invitation Secret: you can create one from Mist portal at the following path: Organization -> Mobile SDK
mstOrgCredentialsManager.enrollDeviceWithToken(invitation_secret);
You will get the required detail in enrollment callback
MSTOrgCredentialsCallback.onReceivedSecret(String orgName, String orgID, String orgSecret, String error,String envType)
Use above required info for starting the SDK like following
MSTCentralManager mstCentralManager = new MSTCentralManager (application, orgID,orgSecret, mstCentralManagerIndoorOnlyListener);
Call start API of MSTCentralManager to start the SDK
mstCentralManager.start();
To stop receiving callbacks from Mist SDK use:
mstCentralManager.stop();
To get location information from Mist SDK you need to implement MSTCentralManagerIndoorOnlyListener or MSTCentralManagerListener callbacks in your application.
Location response is used to know the position of the user in that particular floorplan. For getting the coordinates of the user’s location we can use the following callback
onRelativeLocationUpdated(MSTPoint relativeLocation, MSTMap[] maps, Date dateUpdated)
Returns updated location of the mobile client (as a point (X, Y) measured in meters from the map origin. You can get the map detail of your current map from maps[0].
MSTPoint x: relative x y: relative y hasMotion: is th user in motion mstPointType: type Cloud, Last known latency: latency in the network heading: compass heading headingFlag: availability of compass heading
For more detail, you can see the implementation in the sample app here
Mist SDK provides you proximity related and area related notification. Using this you can provide contextual information to your user based on the proximity and area they are in. vBeacon: vBeacon are Mist patented technology using which you can provide proximity-related information and the good thing is you can move this vBeacon where ever you want to place them in your floorplan and never have to worry about any battery or relocation problems.
You can use ranging API for vBeacon similar to what you can do for real beacons.
You will get the vBeacon notification in the following callback
onNotificationReceived(Date dateReceived, String message)
The type of message let you know whether that is for vBeacon or zone, for vBeacon its ‘zone-event-vb’
For more detail, you can see the implementation in the sample app here
Zone: The zone is like a big area or room for which you might want to get the notification to provide vicinity related information to your customer.
You will get the zone notification in the following callback
onNotificationReceived(Date dateReceived, String message)
The type of message let you know whether that is for vBeacon or zone, for zone its ‘zones-events’
For more detail, you can see the implementation in the sample app here
public void onLocationUpdated(LatLng location, MSTMap[] maps, SourceType locationSource, Date dateUpdated);
This method returns the updated location of the mobile client (as a point (X, Y) measured in meters from the map origin, i.e., relative X, Y).
public void onMapUpdated(MSTMap map, Date dateUpdated);
This method returns the updated map for the organization.
public void onBeaconDetected(MSTBeacon[] beaconArray, String region, Date dateUpdated);
This method returns the ArrayList of beacons that were found in the region of the registered organization.
public void onBeaconListUpdated(HashMap<String, HashMap<Integer, Integer[]>> beaconList, Date dateUpdated);
This method returns a HashMap of beacons with UUID as the key, that is found in the organization.
public void onPressureUpdated(double pressure, Date dateUpdated);
This method returns the updated pressure when available to the app. The pressure will be a double measured in millibars.
public void onBeaconDetected(JSONArray jsonArray, Date date);
This method returns the JSONArray of beacons that were heard in a second.
public void onVirtualBeaconListUpdated(MSTVirtualBeacon[] virtualBeacons, Date dateUpdated)
This method returns an array of virtual beacons associated with the current map of the Organization.
public void onClientInformationUpdated(String clientName);
This method returns clientName information
public void onMistErrorReceived(String message, Date date);
This method notifies the host application about any errors encountered.
public void onMistRecommendedAction(String message);
This method notifies the host application about any actions that need to be taken.
public void receivedLogMessageForCode(String message, MSTCentralManagerStatusCode code);
This method notifies the host application about the status of the MSTCentralManager.
public void receivedVerboseLogMessage(String message);
This method notifies the host application about the verbose state of the MSTCentralManager status.
Mist SDK do have power optimised way of working in the background for the use case of analytics. You can specify Send-Time and Rest-Time for SDK to work in the background.
Send-Time: SDK will work for the mentioned minutes and then will rest for the specified minutes Rest-Time: SDK will stop collecting data and sending it to cloud for the specified number of minutes.
You also have the option to set the Beacon scanning mode as well.
We can set state and paraters with something like below:
Background :
mstCentralManager.setAppMode(new AppModeParams(AppMode.BACKGROUND,BatteryUsage.LOW_BATTERY_USAGE_LOW_ACCURACY,mShouldWorkInBackground,mSendDuration,mRestDuration))
Foreground:
mstCentralManager.setAppMode(new AppModeParams(AppMode.FOREGROUND,BatteryUsage.HIGH_BATTERY_USAGE_HIGH_ACCURACY,mShouldWorkInBackground,mSendDuration,mRestDuration))
For more detail, you can see the implementation in the sample app here
App wakeup wakes up the app from killed state when it is in the range of registered beacon. This is an app feature. It can be used to start SDK in background for data collection and analytics.
For wakeup, we are using the Google Nearby API
Sample for the wake up which can be found here
- Mist map
- Jibestream (under development)
- Micello
Conversion from Mist coordinates to other maps Jibestream :
jibestreamX = (mistX *1000)/mmpp
jibestreamY = (mistY *1000)/mmpp
Where mmpp is MilliMeterPerPixel which is specific to map and will be provided by jibestream itself
For further questions please reach out to support@mist.com